Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Building 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:
  • Verified answer
    Michael E. Gernaey Profile Picture
    40,300 Super User 2025 Season 1 on at
    Optional Upload of Documents from Power Apps to Power Automate
    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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,524 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,906 Most Valuable Professional

Leaderboard