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 Platform Community / Forums / Power Apps / Making a condition a f...
Power Apps
Answered

Making a condition a file-upload

(0) ShareShare
ReportReport
Posted on by 34

We have several flows which take an MS Form submission, including file upload, and creates a SharePoint list item, including attaching the file(s). That all works perfectly.

 

The problem occurs when someone fills out the form but does not upload a file (which is a valid, a file is not required.). Everything works (the SharePoint item is still created) but PowerAutomate flags it as a fail because the file-handling steps have no file to process. Eventually people are going to get so used to seeing the false-fails that we will miss investigating a real one.

 

Seems that a simple Condition step to bypass the file-handling stuff is all we need....BUT I cant figure out how to say "if a file was (or was not) uploaded...." for the condition.

 

Any nudges in the right direction would be most appreciated.

Categories:
  • rsaikrishna Profile Picture
    3,703 on at

    @BFlow 

     

    In your Power Automate, you can handle this issue with following steps:

    1. After Get response details action, place a compose action by selecting Upload file property from your MS Form.

    2. After compose action, place Parse JSON action and place the sample output of above compose action and content as Outputs of above compose.

    3. Whenever ParseJSON action thows error, it means there is no file uploaded with the form. If there is no error, it means a file is uploaded with the MS Form. 

     

    In the above steps, you need to use "Configure run after"  option to handle the exceptions. If you handle the exceptions, then your flow will NOT show as failed.

     

    Example:

    rsaikrishna_0-1632410598766.png

    rsaikrishna_1-1632410646011.png

     

    Reference article: https://docs.microsoft.com/en-us/learn/modules/error-handling/2-configure-run-after

     

    Regards

    Krishna Rachakonda

    If this reply helped you to solve the issue, please mark the post as Accepted SolutionMarking this post as Accepted Solution, will help many other users to use this post to solve same or similar issue without re-posting the issue in the group. Saves a lot of time for everyone.

     

  • Verified answer
    BFlow Profile Picture
    34 on at

    Hello @rsaikrishna Thank you for the suggestion. The solution we've arrived at is even simpler: We put in a Compose step and called the File Upload from Forms. This step will never fail, whether there is a file uploaded or not. Then we use a Condition wrapper: if the previous step's output is null, we skip the file-handling stuff, otherwise we do it.

     

    Best

  • PowerAppUser25 Profile Picture
    15 on at

    Hi @BFlow ,

    Imagine you have a process where you upload an Excel file that contains a list of application names. You also have a SharePoint list called "Application Details" where you store these application names.

    Now, you want to make sure that when you upload this Excel file:

    1. If any application name in the Excel file already exists in the "Application Details" SharePoint list, it shouldn't be added again.
    2. Only the new application names (ones that aren't already in the SharePoint list) should be added.

    To do this, your flow needs to check each application name in the Excel file against the existing list in SharePoint:

    • If an application name from the Excel file matches one already in the SharePoint list, the flow should ignore it.
    • If an application name from the Excel file doesn't match any in the SharePoint list, the flow should add it to the list.

     

    I have Application Id column which is lookup column it will fetch the application id from application list, 

    I want to check if both Application ID and Directory group is already present in the list it should not add the data in Directory group list. Please find the images

     

     

    ApplicationSS.png
    DirectorygroupSS.png

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard