- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2021 06:39 AM
Hello everyone,
I am currently working on a flow in the flow designer and my flow looks as follows:
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?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2021 08:41 AM
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.
Palani

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2021 07:17 AM
Hi Andrew,
Your flow designer image is not visible. Can you send again
Thank you,
Palani
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2021 07:48 AM
Hi Palani,
You should be able to see it now, thanks for letting me know.
Andrew

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2021 08:19 AM
Hi Andrew,
There is an out of box option available in Flow. You can follow these steps:
1) In Set Flow Variable step drag and drop flow variables from Data tab.
2) If you move your mouse over the variable, you will see +fx button visible. Refer below image. Click on it
3) You will see options menu
4) Select Math > Add
5) Specify the Number with 1 and click Apply. Note: Apply button may be disabled. After entering value in Number text box, press tab key. This button is visible only after that. Refer image below
6) You will not get confirmation message after adding. To confirm that the transforms is added, refer the applied transforms section (Refer the 3rd image where it is highlighted)
Note: If you add multiple times, then the transform will be applied multiple time and the number is incremented multiple times. Make sure you see only one entry applied transforms
7) Now the counter is added.
Palani
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-30-2021 08:27 AM
Hi Palani,
Thanks for showing me this, I didn't notice this. However I am still running into a problem. When I got to the 'Math' section, I do not see the 'Add' option. It almost seems to be acting as though my flow variable is an array when it is clearly an integer.
Any insight into why this might be happening?
Thanks,
Andrew O'Connor