Skip to main content

Notifications

Community site session details

Community site session details

Session Id : NRh33fY/kDh9r4N9sOIVeV
Power Automate - Building Flows
Unanswered

Power Automate Flow Error: Analyze Document Action Expects Body as Object, Not String

Like (1) ShareShare
ReportReport
Posted on 22 Feb 2025 12:19:59 by

Hello Power Automate Community,

I'm encountering an unexpected issue with my flow that was previously running without any problems. My flow uses the Analyze Document for Prebuilt or Custom models (v4.x API) action to process PDFs, but it now fails with the following error:

Error:
Action 'Analyze_Document_for_Prebuilt_or_Custom_models_(v4.x_API)' failed:
The API 'formrecognizer' returned an invalid response for workflow operation 'Analyze_Document_for_Prebuilt_or_Custom_models_(v4.x_API)' of type 'OpenApiConnection'.
Details: The API operation 'AnalyzeDocumentV40' requires the property 'body' to be of type 'Object' but is of type 'String'.

Flow Overview:

  • Trigger: Recurrence
  • Action 1: List files in a root folder
  • Action 2: Filter for PDFs
  • Action 3: For each PDF file:
    • Extract JobID from filename
    • Retrieve corresponding case data
    • Get Content from PDF
    • Analyze Document using Form Recognizer v4.x

JSON Snippet Being Passed:

Here's the JSON being used in the Analyze Document action:

 
json
{
"$content-type": "application/pdf",
"$content": "@{body('Get_Content_from_PDF')}"
}

Additional Troubleshooting:

To isolate the issue, I also tried using the file path from the filtered array as the input to the Analyze Document action,

  • Michael E. Gernaey Profile Picture
    42,027 Super User 2025 Season 1 on 25 Feb 2025 at 04:45:12
    Power Automate Flow Error: Analyze Document Action Expects Body as Object, Not String
    Hi,
     
    I am not able to see the v4 in this environment, but for V3 it expects an object for the data.
     
    Do you share what Property you are setting the string in? open the action and share that.
     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - Building Flows

#1
stampcoin Profile Picture

stampcoin 87

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 70 Super User 2025 Season 1

#3
David_MA Profile Picture

David_MA 48 Super User 2025 Season 1

Overall leaderboard