How to start for each loop from second record in flow designer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 04:28 AM
How to start for each loop from second record in flow designer
On catalog item having list type variable which contains records
want to start for each loop from second record from that list.
how to do this?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 04:38 AM
Hi @shweta14 ,
Here is the logic.
1. Move the list to an array variable.
2. Remove the 1st element which is [0]th element from the array.
3. now apply for each. by doing so your applying foreach by removing 1st element. (may be you can create an action for removing 1st element,)
example code :
let myArray = [1, 2, 3, 4, 5];
myArray.shift(); // removes the first element, which is 1
console.log(myArray); // output: [2, 3, 4, 5]
I hope this helps...
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-22-2024 02:15 AM
Hi Sohail,
Is there any other way to remove first element or start with second element without custom action creation.
