cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
sfoerst
Level: Powered On

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

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

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
thirdimage

Power Automate Community User Group Member Badge

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

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (6,291)