Keep a form flow working when an optional file is missing
Inspect the failed run to see what the upload field contains when no file is supplied. Add a condition before file parsing: handle the empty response without fetching an attachment, and process the file only when a valid response is present. Test both paths and check the resulting task.
What you need
For an operations team whose form-to-task flow fails when someone skips an optional upload.
- A redacted failed run with the upload field and failed action.
- The form question settings and flow owner’s intended no-file behavior.
- A safe test form and destination task list.
Keep an optional upload from breaking a form-to-task flow when no file is provided.
- Inspect the upload response for a submission without a file; record its actual value and type.
- Place a condition before the parse or retrieval step and route an empty response to the approved no-file path.
- For a supplied file, retain the normal parse and retrieval path; handle access or invalid-file errors separately.
- Submit one safe test with a file and one without. Verify that each creates exactly the intended task and clearly records whether a file was supplied.
One request has a file; one does not
Synthetic test submissions using a form where the attachment is optional.
Scroll the table to see all columns.
| Response | Upload value | Expected path | Expected task |
|---|---|---|---|
| F-101 | sample.pdf supplied | Retrieve and attach file | One task with file |
| F-102 | Null | Skip file processing | One task; no file noted |
F-102 should not enter a parser that requires file content. A green run alone is insufficient: check that both tasks exist and F-101’s file opens.
What to hand over
A two-path test record showing the input, chosen branch, task result and attachment status.
Limitation. The exact upload response and required handling depend on the form, connector and flow configuration; an empty check cannot fix file-permission errors.
Next step
Bring a redacted failed run and the expected no-file behavior to discuss the workflow.
Related guides
Sources
- Microsoft Q&A: Optional file upload error (accessed 24 November 2026)
- Microsoft Learn: Expression cookbook (accessed 24 November 2026)
- Microsoft Learn: Troubleshoot flow errors (accessed 24 November 2026)