Is there a way to extract the interfaces out of the list returned when we do an a!applyComponents?

Is there a way to extract the interfaces out of the list returned when we do an a!applyComponents?

For example, I'm using the choose() function with an a!applyComponents like this:

choose(
local!currentStep,

rule!interface1(),

a!applyComponents(
function: rule!interfaceLoop(index: _, array: ri!array),
index: _,
arrayVariable: local!itemsToken),

rule!interface6()
)

But when using the applyComponents here it's evaluated as:

choose(
local!currentStep,
rule!interface1(),
{
interfaceLoop(index: 1, array: ri!array),
interfaceLoop(index: 2, array: ri!array),
interfaceLoop(index: 3, array: ri!array),
interfaceLoop(index: 4, array: ri!array)
},
rule!interface6()
)

Is there a way to extract the interfaces returned by the a!applyComponents so if local!currentStep=3, it would return the interfaceLoop(index:2, array:ri!array) instead of rule!interface6() ?

OriginalPostID-221284

OriginalPostID-221284

  Discussion posts and replies are publicly visible

Parents
  • Yeah, we kind of had to rethink how we structured the interfaces. Basically if the current step is on the 'array' interface (interfaceN), we step through the indexes of that array until we reach the end of the array, and then we would increment the currentStep to get to the next interface (interface3). Kind of like this:

    choose(
    local!currentStep,
    rule!interface1(),
    rule!interfaceN(
    index: local!index,
    array: local!array
    ),
    rule!interface3()
    ),

    a!buttonWidget(
    label: "Next",
    value: local!currentStep+1,
    saveInto: {
    if(and(local!currentStep=2, local!index<count(local!array)),
    a!save(local!index, local!index+1),
    a!save(local!currentStep, save!value)
    )
    }



Reply
  • Yeah, we kind of had to rethink how we structured the interfaces. Basically if the current step is on the 'array' interface (interfaceN), we step through the indexes of that array until we reach the end of the array, and then we would increment the currentStep to get to the next interface (interface3). Kind of like this:

    choose(
    local!currentStep,
    rule!interface1(),
    rule!interfaceN(
    index: local!index,
    array: local!array
    ),
    rule!interface3()
    ),

    a!buttonWidget(
    label: "Next",
    value: local!currentStep+1,
    saveInto: {
    if(and(local!currentStep=2, local!index<count(local!array)),
    a!save(local!index, local!index+1),
    a!save(local!currentStep, save!value)
    )
    }



Children
No Data