Increasing the value of a flow variable +1

Andrew105
Kilo Contributor

Hello everyone,

I am currently working on a flow in the flow designer and my flow looks as follows:
find_real_file.png

In my loop, I would like to run the following options until the flow variable 'position' (defined on step 2 as an integer = 0) is equal to a value defined in the loop, essentially mimicking your regular for loop. Therefore, I would like to increase the value of position +1 on step 19. Is there a way to do this in flow designer or even using a script for the value of the flow variable? If not what would be a good alternative to this method?

1 ACCEPTED SOLUTION

Hi Andrew,

I upgraded my PDI to Rome. Not sure whether it is added to Rome. There is an alternate way :). You can use inline script.

Below code can be used in the inline script. This takes the flow variable position and increment by 1.

var data = fd_data.flow_var.position + 1;
return data;
 
You need to click the inline script icon available next to the text box to add script. Refer the below screenshot:
find_real_file.png
Thank you,
Palani

View solution in original post

7 REPLIES 7

Hi Andrew,

I upgraded my PDI to Rome. Not sure whether it is added to Rome. There is an alternate way :). You can use inline script.

Below code can be used in the inline script. This takes the flow variable position and increment by 1.

var data = fd_data.flow_var.position + 1;
return data;
 
You need to click the inline script icon available next to the text box to add script. Refer the below screenshot:
find_real_file.png
Thank you,
Palani

Hi Andrew,

Is your issue resolved?

Please mark my response as accepted solution if it resolves your question. 

Thank you,

Palani

Thank you,
Palani

Can I use this within an array?  I need to add these term amounts 

latroyamitchell_0-1723662342986.png