cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

interlace Apply to Each loop

Hi,

is it possible to interlace 2 apply to each loops.

One Loop is to get a planner id the other loop to get sharepoint item id an than to compare the values.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: interlace Apply to Each loop

Hi @sfoerst,

I don’t think Planner Id could be compared with the item Id, as they are under different identification mechanisms.

If your SharePoint list contains a field that stores the Planner Id, then we could compare the planner id with this field.

Nested loop is not supported under Microsoft Flow currently, but we could workaround it with the steps below:

  • Add a proper trigger, here I use Flow button trigger.
  • Add “Get items” action.
  • Add Variable-> Initialize variable, Name set to ItemArray, Type set to Array, Value set to value content of “Get items” action.
  • Add “List my plan” action, specific the Microsoft Planner connection.
  • Add a “Apply to each”, output set to value content of “List my plan” action.
  • In “Apply to each”, add a “Do until”, condition set to @empty(variables('ItemArray')).
  • Within “Do Until”, add a Condition in which you can compare planner id and item id. Then add “Compose” action, Input set to following formula:

 ”@skip(variables('ItemArray'),1)”

Add “Set variable” action, choose ItemArray, Value set to output of “Compose” action.

  • Add “Set variable 2” action, choose ItemArray, Value set to output of “Select” action.

Image reference:5.PNG

 

2.PNG

 3.PNG

 4.PNG

 

Best regards,

Kris 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
Highlighted
Community Support
Community Support

Re: interlace Apply to Each loop

Hi @sfoerst,

I don’t think Planner Id could be compared with the item Id, as they are under different identification mechanisms.

If your SharePoint list contains a field that stores the Planner Id, then we could compare the planner id with this field.

Nested loop is not supported under Microsoft Flow currently, but we could workaround it with the steps below:

  • Add a proper trigger, here I use Flow button trigger.
  • Add “Get items” action.
  • Add Variable-> Initialize variable, Name set to ItemArray, Type set to Array, Value set to value content of “Get items” action.
  • Add “List my plan” action, specific the Microsoft Planner connection.
  • Add a “Apply to each”, output set to value content of “List my plan” action.
  • In “Apply to each”, add a “Do until”, condition set to @empty(variables('ItemArray')).
  • Within “Do Until”, add a Condition in which you can compare planner id and item id. Then add “Compose” action, Input set to following formula:

 ”@skip(variables('ItemArray'),1)”

Add “Set variable” action, choose ItemArray, Value set to output of “Compose” action.

  • Add “Set variable 2” action, choose ItemArray, Value set to output of “Select” action.

Image reference:5.PNG

 

2.PNG

 3.PNG

 4.PNG

 

Best regards,

Kris 

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
firstImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

firstImage

Join the new Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (7,899)