Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Flow Hangs on Apply to Each.

(0) ShareShare
ReportReport
Posted on by 347

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

  • hnguy71 Profile Picture
    hnguy71 347 on at
    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

  • v-bacao-msft Profile Picture
    v-bacao-msft on at
    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,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,691

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 65,019

Leaderboard