logo
search
Others

How to Handle Optional File Uploads in Power Automate for Microsoft Forms

Phi Hung VoPhi Hung Vo Oct 20, 2026 868 views

Question details

The user needs a reliable way to process optional file uploads from Microsoft Forms in Power Automate without the flow failing due to null values.

How to Handle Optional File Uploads in Power Automate for Microsoft Forms
Product
Power Automate, Microsoft Forms
Device & OS
not provided
Scenario
Creating a Power Automate flow triggered by a Microsoft Forms submission that includes an optional file-upload question.
Observed behavior
The flow fails when a Switch action attempts to process null file content because the respondent left the optional file-upload question empty.
Before you start

Ensure you have access to edit your Power Automate flow and that your Microsoft Forms trigger is actively capturing form responses.

Solution 1Recommended

Replace the Switch Action with a Condition Action

Use a Condition action to evaluate whether the file upload field is empty or null before attempting to process the file content, effectively preventing flow failures.

A Switch action expects a definitive value to evaluate against its configured cases. When an optional file upload is skipped in Microsoft Forms, the output is null, which causes the Switch action to fail. By implementing a Condition action instead, you can safely branch your flow based on whether a file exists.

1
Locate the failing Switch action

Open your flow in Power Automate, go to 'Edit' mode, and find the Switch action that is currently handling the file upload processing.

2
Delete the Switch action

Click the three dots (More commands) on the Switch action and select 'Delete' to remove it from your flow.

3
Add a Condition action

Click 'New step', search for 'Condition', and add it to the flow where the Switch action used to be.

4
Configure the null check

In the Condition block, select the dynamic content for your Microsoft Forms file upload in the first field. Set the operator to 'is not equal to', and in the second field, type the expression 'null'.

5
Set up the processing branches

In the 'If yes' branch (meaning a file was uploaded), add your normal file processing steps. Leave the 'If no' branch empty or add alternative steps for when no file is submitted.

Replace the Switch Action with a Condition Action
Troubleshooting Tip: If you ever need to share flow screenshots in community forums for troubleshooting, ensure you remove private information and use the 'Insert image' tool rather than attempting to paste directly from a snipping tool.
Free Microsoft Office alternative

Looking for a simpler way to manage forms and documents?

While Power Automate requires complex logic to handle basic form scenarios, WPS Office offers a streamlined suite for managing your documents, data, and PDFs without the steep learning curve. It is fully compatible with Microsoft Office formats and provides robust tools for everyday productivity.

Free and lightweight office suite for seamless document managementFully compatible with Microsoft Word, Excel, and PowerPoint formatsBuilt-in PDF editor and data management toolsIntuitive user interface for an effortless migration
microsoft office alternative - wps office

Frequently Asked Questions

Why does a Switch action fail with empty file uploads in Power Automate?

A Switch action requires a specific value to match against its defined cases. When a user leaves an optional file upload empty in Microsoft Forms, the returned value is null. The Switch action cannot process null values, which results in a flow failure.

How do I use expressions to check for null values in Power Automate?

You can use the 'empty()' expression in a Condition action. By configuring the condition as `empty(outputs('Get_response_details')?['body/YourFileField'])` is equal to 'true', you can accurately branch your flow based on whether data exists.

Can I prevent null file errors directly in Microsoft Forms?

Yes. If your process absolutely requires a file, you can toggle the 'Required' setting on the file upload question in Microsoft Forms. This ensures the flow will always receive a file, completely bypassing the null value issue.