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 / Optional Upload of Doc...
Power Apps
Answered

Optional Upload of Documents from Power Apps to Power Automate

(3) ShareShare
ReportReport
Posted on by 12
Hi All, 

I am struggling with a feature to implement an Optional! file upload as part of submitting form content from Power Apps to Power Automate using the Flow.Run() function.

The PowerAutomate Flow is set up to get a required text input and an optional file input. I am calling the flow with 

Flow.Run(
    JSON(
        Patch (
            Form.Updates, {Test1: String_Variable1, Test2: String_Variable2}),
        JSONFormat.IgnoreBinaryData & JSONFormat.IgnoreUnsupportedTypes
    ),
    {file:{contentBytes: Attachment_File, name: Attachment_Name}}
);

Submitting form content like this works well, when a file is attached. If not it yields the error: FlowName.Run failed: { "error': { "code": "TriggerInputSchemaMismatch", "message": "The input body for trigger manual' of type 'Request' did not match its schema definition. Error details: 'Invalid type. Expected String but got Null.,Error details: 'Invalid type. Expected String but got Null.'. 

How can I make it work?

Thank you so much! I appreciate any help!
 
Categories:
I have the same question (1)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,978 Moderator on at
    HI
     
    How exactly are you sending it though when you have no attachment.
     
    That code above should fail if you use it and there is no attachment. If you want it to be optional, then you have to NOT pass anything, not pass the json with blanks essentially.
     
    So I would have an If to check if you have an attachment, if so use that code, if not just pass the things that are required

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,041

#2
11manish Profile Picture

11manish 676

#3
Valantis Profile Picture

Valantis 655

Last 30 days Overall leaderboard