Notifications
Announcements
I'm trying to trigger a flow from a button in my Power App, but I keep getting the following error:
{ "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.'" } }
The attachment field is optional, but even when no file is uploaded, this error still occurs.
Here is the code behind the button:
// Call the flow and store the result Set( varResult; 'Arbeidsrecht:Uitspraak'.Run( Coalesce(TextInput1.Text; ""); // required field { text_1: If(IsBlank(TextInput2.Text); ""; TextInput2.Text); text_2: If(IsBlank(TextInput3.Text); ""; TextInput3.Text); file: If( CountRows(BijlageVeld1.Attachments) = 0; { name: "geen_bijlage.txt"; contentBytes: "" }; { name: Coalesce(Last(BijlageVeld1.Attachments).Name; ""); contentBytes: Coalesce(Last(BijlageVeld1.Attachments).Value; "") } ) } ) ); // If a result is returned, reset the input fields If( !IsBlank(varResult); Reset(TextInput1); Reset(TextInput2); Reset(TextInput3); Reset(BijlageVeld1) )
What could be causing this error, and how can I ensure the flow accepts the input correctly even when no attachment is provided? With the help of ChatGPT I tried about 100 different formula's and none of the work.
Set( varResult; 'Arbeidsrecht:Uitspraak'.Run( Coalesce(TextInput1.Text; Text("")); // required field { text_1: If(IsBlank(TextInput2.Text); Text(""); TextInput2.Text); text_2: If(IsBlank(TextInput3.Text); Text(""); TextInput3.Text); file: If( CountRows(BijlageVeld1.Attachments) = 0; { name: "geen_bijlage.txt"; contentBytes: Text("") }; { name: Coalesce(Last(BijlageVeld1.Attachments).Name; Text("")); contentBytes: Coalesce(Last(BijlageVeld1.Attachments).Value; Text("")) } ) } ) );
Attachment_Upload_Test.Run( If( CountRows(Attachments.Attachments) > 0, { file: With( {File_c: First(Attachments.Attachments)}, { name: File_c.Name, contentBytes: File_c.Value } ) }, Blank() ) )
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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 739 Most Valuable Professional
Michael E. Gernaey 343 Super User 2025 Season 2
Power Platform 1919 268