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 Automate / How to set optional `I...
Power Automate
Answered

How to set optional `Image or document input` to prompt?

(1) ShareShare
ReportReport
Posted on by 18
When using Prompt with `Image or document input` in Power Automate, that input parameter will become required, but I want it to be nullable.

I have tried passing null, an empty string, and "AA==" in the expression, but they will throw `Invalid input: Input parameters are invalid for your model` (`Unable to identify the mimetype input`).

Although the Text input of the prompt is marked as required in Power Automate, I can pass `null` to it without error. I just want to do the same thing to `Image or document input`.
Categories:
I have the same question (0)
  • Suggested answer
    CedrickB Profile Picture
    Microsoft Employee on at
    Prompts multi modal inputs don't support null values.
    There are 2 possible workarounds for you scenario:
    1. Create a empty word file and export to PDF. When you want to pass a null document, send the empty PDF.
    2. Create a copy of you prompt with same instruction but without document input. Call the original or the copy accordingly.
  • Verified answer
    Valantis Profile Picture
    3,240 on at
     

    You can’t make “Image or document input” nullable in a prompt.

    That input expects an actual file of a supported type sending null/empty triggers the MIME-type error you’re seeing.

    There’s no documented setting to mark that input optional in Prompt builder.

     

    try this workaround:

     

    • Build two prompts:
      • Prompt A: Text-only.
      • Prompt B: Text + Image or document input.
    • In your cloud flow, add a Condition before calling the prompt:
      • If your “File content” (or file reference) is empty, call Prompt A.
      • Else, call Prompt B and pass the file.
    • Example expressions you can use in the Condition:
      • empty(variables('FileContent'))
      • Or if you store the file in a property: empty(triggerBody()?['FileContent'])
    Verify:
    Run the flow twice—once with no file (should invoke Prompt A successfully) and once with a valid PNG/JPG/JPEG/PDF under the documented limits (should invoke Prompt B successfully).
     

    Why this is necessary:

     

    • Image/document inputs require a real file and supported types and sizes; the docs list formats and limits but don’t provide an option to make the parameter optional. Passing null/empty means the runtime can’t determine a MIME type, which leads to the error. Source links below show the supported input types and prompt creation flow.
    •  

    check also this links for more info:

     

     

    Best regards,

    Valantis

     

    ✅ If this helped solve your issue, please Accept as Solution so others can find it quickly.

    ❤️ If it didn’t fully solve it but was still useful, please click “Yes” on “Was this reply helpful?” or leave a Like :).

    🏷️ For follow-ups  @Valantis.

    📝 https://valantisond365.com/

     

  • Valantis Profile Picture
    3,240 on at

    Hi @SC-02030600-0,

    Just wanted to check in and see if everything is working now. If you still need any help, feel free to let me know.

    Also, if the issue is resolved, it would be great if you could mark the answer as solved so others with the same question can find it easily.

     

    Thanks and have a great day!

     

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Haque Profile Picture

Haque 607

#2
Valantis Profile Picture

Valantis 456

#3
11manish Profile Picture

11manish 352

Last 30 days Overall leaderboard