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 Yep, it works. If you would like the element (chosen based on the selected index) to show more than one component, opt for a Section Component which can wrap one or more than one component inside it. This way we can also stay away from the fear of flattening. For instance, if you are expecting the rule!interface1() to display more than one component, make sure that all the components are wrapped in the Section Component.

    If the rule!interface1() contains an array definition of two Section Components or an two Text Field Components, they will be flattened.

    Finally I would like to say that whatever you have specified under 'When we go through this interface it would show' is how the interface is going to be executed as per my knowledge. Simply speaking, the array of array flattens and now each element is able to render ONE component(be it a Section or Text Field or Dropdown Field and so on) at a time.
Reply
  • @nickh Yep, it works. If you would like the element (chosen based on the selected index) to show more than one component, opt for a Section Component which can wrap one or more than one component inside it. This way we can also stay away from the fear of flattening. For instance, if you are expecting the rule!interface1() to display more than one component, make sure that all the components are wrapped in the Section Component.

    If the rule!interface1() contains an array definition of two Section Components or an two Text Field Components, they will be flattened.

    Finally I would like to say that whatever you have specified under 'When we go through this interface it would show' is how the interface is going to be executed as per my knowledge. Simply speaking, the array of array flattens and now each element is able to render ONE component(be it a Section or Text Field or Dropdown Field and so on) at a time.
Children
No Data