I am getting all opportunities and looping through them incrementing variables that essentially count the # of open, won, lost opportunities. I have tried to do one List Items call and applying a Switch within the result but when i do that the results i get are wildly inaccurate. However, when i do 3 GET calls for open, won and lost then loop through those arrays and count the opportunties that are open/won/lost i get correct numbers back..
This is the second time i have tried to use a switch in a loop and had issues. Anyway, wanted to see if anyone experienced this as well.
I have had mixed results using a Switch action but nothing like you are experiencing. In my case, items that should match the particular switch branch just don't match..... In many cases it works as expected.
That said, I do want to mention that you don't need to loop through the Get Items result to get a count - you just need to use a length expression:
Hi @tcorcor11 ,
I used Switch Case in my flow and it worked perfect. Please have a look at the flow below:
The expression used for the switch value is
Are you using the same way?
Hope this helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Thanks Scott. This works great for length but have you used an expression to SUM an attribute in an array? Currently, i am incrementing a variable to get the SUM of an item in an array. Thanks again
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
Many congratulations to the Season 1 2021 Flownaut Crew!
Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.
Check out the community blog page where you can find valuable learning material from community and product team members!