cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
hnguy71
Level 8

Flow Hangs on Apply to Each.

I have a few flow that started acting up. On Apply to Each it says that it successfully ran but as I look into it there's no data to be provided. Only when I maunally press "Resubmit" will the flow actually run. Is there a fix for this?

 

apply_to_each_hang.PNGresubmit.PNG

2 REPLIES 2
Community Support Team
Community Support Team

Re: Flow Hangs on Apply to Each.

Hi @hnguy71 ,

 

Could you share screenshots of Flow configuration?

If you want to save the attachment in the list item to the specified library, please make sure that list item does contain the attachment.

If there are no attachments, Apply to each traversed Body will be an empty set, and the actions contained in it will not be executed.

 

Or you could consider adding a Condition to determine whether the current item contains an attachment, and only execute the following action when the attachment is included.

Expression reference:

length(body('Get_attachments'))

Image reference:

21.PNG

Hope it helps.

 

Edit:

We can use Has attachments directly to determine if an attachment is included in the item.

22.PNG

 

Best Regards,

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

Re: Flow Hangs on Apply to Each.

Good morning, @v-bacao-msft 

 

Here's my full flow config:

 

flow_config1.PNGflow_config2.PNG

 

The logic is to:

1. When an item is created

2.  Set variables to retrieve: Folderpath, CreatedBy, Geomarket, ProductLine, DocType, Month, Year, TeamAddress

3. Get Items in SP List filtering out by Geomarket, ProductLine, DocType, Month, Year

4. Set variable Count:  length(body('Get_items')?['value'])

5. Each item created has 1 attachment. There's no need to do a check if it exists. Retrieve file attachment ID

6. Apply to each:

  • Get attachment content
  • Get file extension from original file
  • Create new file in MS Teams with standarized naming convention and original file name extension.

7. Get file content using path: Checks to see if the file was successfully created in MS Teams

8. If not, Failed Scope: Email user.

 

Here's my Apply to each step that's hanging:

 

flow_config3.PNG

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

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 Flow Community Video Gallery!

Users Online
Currently online: 175 members 4,666 guests
Please welcome our newest community members: