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
Community Support
Community Support

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
Community Support
Community Support

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
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Users online (6,104)