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 / 'Recognize_text_in_an_...
Power Automate
Unanswered

'Recognize_text_in_an_image_or_a_PDF_document' failed

(0) ShareShare
ReportReport
Posted on by 7

Hi, 

I am trying to create a flow that checks the body of incoming emails for keywords like "invoice" "receipt," "folio." If the emails do contain those keywords, then the email is saved as a PDF file in a One Drive folder. That part of the flow works. However, if the email body does not contain those keywords, then I want to search any attached PDFs for those keywords. If the attached PDF contains any of those keywords, then I want the PDF attachment to be saved in a OneDrive folder. I attempted to use the "Recognize text in an image or PDF document" function to get the raw text, which I would then apply a Condition function to, but I got the error below:

{"operationStatus":"Error","error":{"type":"Error","code":"InvalidPredictionInput","message":"InvalidImage. The file submitted couldn't be parsed. This can be due to one of the following reasons: the file format is not supported ( Supported formats include JPEG, PNG, BMP, PDF and TIFF), the file is corrupted or password protected.","properties":{"BackendErrorCode":"InvalidInferenceInput","DependencyHttpStatusCode":"400"},"innerErrors":[{"scope":"Record","target":"single","code":"InvalidRecord","type":"Error","properties":{"InnerErrorCode":"InvalidImage","MlIssueCode":"InvalidRecord","MlIssueTarget":"single"}}]},"predictionId":null}

 

Any suggestions? Thanks! 

Power automate pic.PNG
Categories:
  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at
  • Coram1517 Profile Picture
    7 on at

    Ok, thanks! Now which one of the dynamic content outputs from the AI text recognizer should I apply a "Contains" Condition function to?

  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    What does your AI text recognizer output look like?

    Can you please post a screenshot? I suppose you want to add the condition based on a specific field in the output text?

     

  • Coram1517 Profile Picture
    7 on at

    I have attached what I currently have. I am not sure how to make the flow search the PDF attachment for keywords like "receipt," "invoice," "folio," etc...

    Power automate pic 2.PNG
  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    @Coram1517 ,

     

    Try the indexOf function. It returns the first occurrence of a string inside another string

    So your expression inside the condition action could be the following

    Or(greater(indexOf(outputs('Compose'),'receipt'),0),greater(indexOf(outputs('Compose'),'invoice'),0),greater(indexOf(outputs('Compose'),'folio'),0))

     

    SudeepGhatakNZ_0-1687211342478.png

     

  • Coram1517 Profile Picture
    7 on at

    I just tried that and go this response. 

    Power automate pic 3.PNG
  • SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    😀

    You need to replace the outputs('Compose') with the action that returns you the contents of your attachment 

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 289

#2
11manish Profile Picture

11manish 282 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 119

Last 30 days Overall leaderboard