Flow designer (Flow Logic) : "Do the following until (The Adventurous Eater)" in Flow logic
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2024 09:25 AM
What the heck is Do-while loop and how it's relates to the other loops (for, while...) ?
The Regular Loop (The Cautious Eater):
- You peek at the options, unsure how much you can handle. So, you grab a plate, take a small portion, and cautiously assess your hunger level. If you're still peckish, you go back for another round, repeating the process until you're comfortably full. But what if you misjudge your appetite and grab too much initially? You might end up feeling uncomfortably stuffed before even trying everything!
while (notFull) {
// Grab a small portion
// Check if still hungry (notFull)
}
It checks the condition (notFull) before each action (grabbing food), ensuring you only eat until you're satisfied. But it might not let you explore all the delicious options if you underestimate your appetite.
The Do-While Loop (The Adventurous Eater):
- You dive headfirst into the buffet, piling your plate high with different dishes. You figure you can always stop later if you get overwhelmed. After each bite, you assess your fullness. If you're still up for it, you keep exploring the culinary delights. But beware, this approach might lead to food coma if you're not careful!
- In programming, this is a do-while loop:
do {
// Grab a large portion (or all of it!)
// Check if still hungry (notFull)
} while (notFull);
Now here comes the Flow Designer's Flow logic : "Do the following until".......
Use Case 1:
So we have to create a incident, if the caller is VIP then we have to create a 5 child Incident based on the current incident and update the Work notes each time the incident gets created...
Here is the Flow logic for the same...
Step 1: I have created a flow variable... if the user is VIP then assign the value 5 to the flow variable.
So after testing here is the results...
As you can see 5 child incident got created....
But here comes the caution 😱😱😱😱😱😱......
Use Case 2:
What if it is not a VIP user ultimately we will try to solve the problem there itself by assigning record value to 0 so that it cannot enter the do while... (Likely you though so since you might don't have the knowledge of the loop until this thread... " You got my back....").
Step 1:
But wait what after testing ....... as we guess it created one child incident.... yessss thats true.
As here we can see.. it created on child incident as it is not a exit control loop like "While or For"....
Thanks for reading the post.....
If you really liked it please hit a helpful button and smash it...