As the title suggests, I want to copy the data from one row 4 times if the value in one column is API, and 2 times if the value is MX Loader. I've tried using the Generate Rows Tool, but keep running into errors such as: "Invalid type in operator==." and "The value did not change after the Loop Expression"
I'm fairly new with this tool and tried adding a condition expression of "
if contains([MX Loader/API],"API")
then + 4
elseif Contains([MX Loader/API], "MX Loader")
then + 2
else Null()
endif "
If anyone has any solutions, it would be greatly appreciated.
Solved! Go to Solution.
HI @Julcas
I have created a workflow for you (attached below) using generate rows.
My suggestion (and this caught me out) is to check the field type of the ColumnsToAdd field because it was a string for me, but generate rows needed an integer to compare it to.
Hope this helps you. Let me know if you have other queries.
- Andrew
That worked! Thank you!
Hi Andrew,
I have a similar query to this. Just that in my case i need a specific value to repeat itself multiple times, till a change of condition in the underlying column. For e.g.see below:
For every change in Level to equal 2 (i.e Level =2) I need the corresponding "DESC" of that Level 2 occurrence to repeat for all subsequent records in a separate column, till the next available instance of Level 2 with a different DESC. The occurrence of "Level =2" will be dynamic, i.e. can occur after any n number of records.
| UNIT | LEVEL | DESC | Required Mapping | 
| A_XYZ | 2 | XYZ | XYZ | 
| A_3 | 3 | aaaa | XYZ | 
| A_4 | 4 | bbbb | XYZ | 
| A_5 | 5 | cccc | XYZ | 
| A_6 | 6 | dddd | XYZ | 
| A_7 | 7 | eeeee | XYZ | 
| A_8 | 8 | fffff | XYZ | 
| A_ABC | 2 | ABC | ABC | 
| A_9 | 3 | ggggg | ABC | 
| A_10 | 4 | hhhh | ABC | 
| A_11 | 5 | iiiiii | ABC | 
| A_12 | 6 | jjjjj | ABC | 
| A_13 | 7 | kkkkk | ABC | 
| A_14 | 8 | llllll | ABC | 
