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

Notifications

Announcements

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 (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,412 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard