How to update the column name in a loop

Hello,
I have a table with 50 columns and 30 rows. It enters a column list loop where the next node does the transpose. After a successful first iteration, the workflow fails because it is unable to update the manipulation string node with the second column name.
How is it possible to update automatically the column name in the loop?
I tried to use the flow variable as the current column name but it failed too.
Thanks,

Hi,

Create the expression for the String Manipulation node in a String Manipulation (Variable) node using the currentColumnName variable.

Example:
Assume we have 5 columns like col1, col2,… and we want to do manipulation on them one by one inside a Column List Loop Start. We want to add a number at the end of each value starting from 0.
The expression we need for the String Manipulation is:
join($col1$, “_0”)
join($col2$, “_1”)

Now how is it possible for us to do this inside a column list loop?
As you mentioned we can use the currentColumnName variable inside the loop, BUT not inside the String Manipulation because we need column name to be enclosed in “$”. Moreover, we cannot put the dollar signs in the expression using the join function since it will give us the string which is the column name inside dollar signs. So we use a String Manipulation (Variable) node to create the whole expression we need for the String Manipulation. Like this:
join("join($", $${ScurrentColumnName}$$, "$, \"_", string($${IcurrentIteration}$$), "\")")

We can use the variable containing the expression in the Flow Variables tab and the “expression” option.

That’s it. Feel free to ask more questions.

:blush:

3 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.