- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2022 06:20 PM
Hello Guys,
I have used the below code in the flow designer for the print logs. but it is running only for the one times in flow designer.
var loop count=0;
var i= 0;
do {
loop_count=loop_count+1;
console.log(num);
i++;
}
while (i < 5);
output: 1,2,3,4,5
here loop count is integer .it is running only one time only.
i have added add operation over here one loop_count but not getting output 1,2,3,4,5 system log. please help
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2022 09:27 PM
>>it is running only one time only.
YES,because you writed [less than 5] at the [until] part ....
The first time you run the loop...the [loop_count] becomes 1 ,and it is [less than 5] ,so the loop is ended.
you need to change [less than 5] to [more than 5]...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2022 10:14 PM - edited 11-24-2022 10:15 PM
As per the image you provided earlier, your flow variable's backend name is not loop_count. See the below image which you provided.
So, in your script, use the proper backend name of your flow variable. In my case it was loop_count.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2022 07:18 PM
It would be something like below.
Output
Set Flow Variables
Log
Until
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2022 09:21 PM
thank you for your inputs . Could you please tell what you have set type of variable in the flow designer ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2022 09:31 PM
Integer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-24-2022 09:27 PM
>>it is running only one time only.
YES,because you writed [less than 5] at the [until] part ....
The first time you run the loop...the [loop_count] becomes 1 ,and it is [less than 5] ,so the loop is ended.
you need to change [less than 5] to [more than 5]...