web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Automate
Unanswered

Apply to each error

(0) ShareShare
ReportReport
Posted on by 11

Hi,

 

I have a purchase request workflow.

The workflow start with a Form asking differents parameters and an optionnal file to join.

The result of the Form is sent to an SP List.

 

In order to fetch the joined file and to copy it into the SP List, I used this:

lielianjie_0-1700061113150.png

With this expression:

json(outputs('Get_response_details')?['body/rd9...6a']) (I trunked the body id).
 
The workflow works nicely with joined file but, I have an error when there is no file joined into the Form.
 
Here is the error:
lielianjie_1-1700061512215.png

 

I'd like the workflow to continue and simply skip this part if there is no file to join. 

 

How can I do that? 

 

Thanks for your help!

Categories:
  • Anchov Profile Picture
    1,986 on at

    You can enhance your flow by adding a condition to check if an attachment has been uploaded. In the "Yes" branch of the condition, you can execute your logic within the 'Apply to each' action. If there is no attachment, the action will be bypassed.

    Anchov_0-1700073250434.png

    Here is the expression from my condition:

    length(outputs('Get_response_details')?['body/re6ccfcacae1144088558ccf4a9cc9013'])

    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

    Cheers!
    Rick Hurt

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 299

#2
11manish Profile Picture

11manish 274 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard