Skip to main content
venkataharishd0002
Inspiring
Jan 21, 2021 11:14 AM UTC
Solved

Relplace applycomponents with foreach

Hi Team,

We have an old code with applycomponents, Can you please help me to replace it with Foreach, I have tried but I'm unable to handle the '_'. Please help

a!applyComponents(
function: a!queryColumn(
field: _
),
array: ri!selectColumns
)

Thanks in advance

    peter.lewis
    Employee
    Jan 21, 2021 2:09 PM UTC

    In order to use a!forEach() instead of a!applyComponents(), you have to reference your data using fv!item instead of the underscore. Try something like this:

    a!forEach(
      items: ri!selectColumns,
      expression: a!queryColumn(
        field: fv!item
      )
    )

    2 replies

    peter.lewis
    Employee
    Jan 21, 2021 2:09 PM UTC

    In order to use a!forEach() instead of a!applyComponents(), you have to reference your data using fv!item instead of the underscore. Try something like this:

    a!forEach(
      items: ri!selectColumns,
      expression: a!queryColumn(
        field: fv!item
      )
    )

    venkataharishd0002
    Inspiring
    Jan 21, 2021 2:31 PM UTC

    Thank you so much Peter. [emoticon:c4563cd7d5574777a71c318021cbbcc8]