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 / Logical operators (AND...
Power Automate
Answered

Logical operators (AND/OR) for search in an OCR text. How to use?

(0) ShareShare
ReportReport
Posted on by 122

Hello everyone,

 

I need to find an action to perform in case of finding some word in a text obtained by OCR. I have tried to use OR but I have not succeeded.

 

Any idea how I could do it?

 

Thanks everyone!! 

I have the same question (0)
  • Verified answer
    Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    If you have the text already and just need to find something inside it, there are a few ways of doing it.

     

    You can use an IF statement like this:

    AgniusBartninka_0-1688126348173.png

    In this case, I set %TextOne% and %TextTwo% that are to be checked for as variables, but you can also pass then as literal values.

    Here's a snippet that you can paste directly into PAD and it will create the action for you:

    IF (Contains(OCRText, TextOne, False) OR Contains(OCRText, TextTwo, False)) = True THEN
    END

     

    It's a bit tricky, as you need to know how to write it. It actually looks like this in the condition action itself:

    AgniusBartninka_2-1688126540934.png

     

     

    Alternatively, you can also use the Parse text action with regex that searches for a certain value. 

    AgniusBartninka_1-1688126529836.png

    This can actually be used in case you also need to find some text that goes before or after the one that you're looking for, so it is more useful when you're trying to not only check if the text contains something, but also find some other values based on your inputs. Here's the snippet:

    Text.ParseText.RegexParseForFirstOccurrence Text: OCRText TextToFind: $'''(%TextOne%)|(%TextTwo%)''' StartingPosition: 0 IgnoreCase: False OccurrencePosition=> Position Match=> Match

     

    If you find my reply to answer your question, please mark it as the preferred solution.

    Thank you.

  • BLabat83 Profile Picture
    122 on at

    Thank you very much!!!!!!!!!!!!!!!!! This is awesome!! 

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 592

#2
Valantis Profile Picture

Valantis 340

#3
11manish Profile Picture

11manish 284

Last 30 days Overall leaderboard