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
  • @nickh Hi, the requirement can be accomplished provided if the array of arrays built by fn!choose() is flattened and below is an example of how you can flatten.


    a!formLayout(
    firstColumnContents: {
    fn!index(
    {
    rule!interface1(),
    \ta!applyComponents(
    \ tfunction: rule!interfaceLoop(index: _, array: ri!array),
    \ tindex: _,
    \ tarrayVariable: local!itemsToken
    \t),
    \trule!interface6()
    },
    local!currentStep,
    null
    )
    }
    )
Reply
  • @nickh Hi, the requirement can be accomplished provided if the array of arrays built by fn!choose() is flattened and below is an example of how you can flatten.


    a!formLayout(
    firstColumnContents: {
    fn!index(
    {
    rule!interface1(),
    \ta!applyComponents(
    \ tfunction: rule!interfaceLoop(index: _, array: ri!array),
    \ tindex: _,
    \ tarrayVariable: local!itemsToken
    \t),
    \trule!interface6()
    },
    local!currentStep,
    null
    )
    }
    )
Children
No Data