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 / Search or filter speci...
Power Automate
Answered

Search or filter specific area/coordinates with recognize text from PDF AI

(1) ShareShare
ReportReport
Posted on by 32

I am using the default action "Recognize text in an image or a PDF document" from AI Builder

Is there a way to add like a quadrant for each image/document?

 

Or is there a way to filter this output to only include coordinates in the lower left quadrant?

 

 

[
 {
 "@odata.type": "#Microsoft.Dynamics.CRM.expando",
 "page": 1,
 "lines@odata.type": "#Collection(Microsoft.Dynamics.CRM.crmbaseentity)",
 "lines": [
 {
 "@odata.type": "#Microsoft.Dynamics.CRM.expando",
 "text": "10000 FARM- ANIMALS MILK",
 "boundingBox": {
 "@odata.type": "#Microsoft.Dynamics.CRM.expando",
 "left": 0.020272931185041865,
 "top": 0.04817338060721935,
 "width": 0.2313408557779566,
 "height": 0.020837619041856763,
 "polygon": {
 "@odata.type": "#Microsoft.Dynamics.CRM.expando",
 "coordinates@odata.type": "#Collection(Microsoft.Dynamics.CRM.crmbaseentity)",
 "coordinates": [
 {
 "@odata.type": "#Microsoft.Dynamics.CRM.expando",
 "x": 0.020272931185041865,
 "y": 0.05078715860550104
 },
 {
 "@odata.type": "#Microsoft.Dynamics.CRM.expando",
 "x": 0.25161378696299846,
 "y": 0.04817338060721935
 },
 {
 "@odata.type": "#Microsoft.Dynamics.CRM.expando",
 "x": 0.25161378696299846,
 "y": 0.06770411064993527
 },
 {
 "@odata.type": "#Microsoft.Dynamics.CRM.expando",
 "x": 0.020272931185041865,
 "y": 0.06901099964907612
 }
 ]
 }
 }
 },

 

 

Categories:
I have the same question (0)
  • Verified answer
    takolota1 Profile Picture
    4,980 Moderator on at

    @askingquestion9 

     

    Yes. You will want to use 1 Filter array action with a more complex condition expression or 2 sequential Filter array actions with simpler condition expressions to filter to only the items below a certain Y coordinate on a scale of 0 to 1 and to only the items below a certain X coordinate on a 0 to 1 scale.

     

    Each object/item there has 4 sets of x-y coordinates and they are ordered as shown below

    IMG_3814.jpeg

    Where there is a bounding box around each piece of text where the 1st coordinates are the top left point of the box, the 2nd are the top right, 3rd are bottom right, & fourth are bottom left.

     

    You can probably just base the coordinates filter on the 1st top left coordinates for each item.

     

    Looks like for the From input of the 1st or only Filter you will need to reference the lines array property so like body(‘OCRaction…’)?[‘lines’]
    Then for the condition expression you will need to reference the 1st coordinate set with something similar to

    item()?[‘boundingBox’]?[‘coordinates’][0][‘x’]

    And

    item()?[‘boundingBox’]?[‘coordinates’][0][‘y’]

    So you can set what coordinates the items returned should be greater than or less than.

  • askingquestion9 Profile Picture
    32 on at

    Thank you! I will try to implement that

    Also thanks for the CSV to Dataset, I found it today and improved the speed of my flows so much!

    I need to go over all your posts, they are a gold mine

  • JStell Profile Picture
    12 on at

    Awesome! This is exactly what I was looking for!

     

    I appreciate it! 👍

  • askingquestion9 Profile Picture
    32 on at

    @takolota  I am trying to filter the array after apply to each 5 using the lines output, but it doesnt even let me add the "item()?['boundingBox']?['coordinates'][0]['x']" in the expression

     

    below is the flow without the filter array

     

    askingquestion9_0-1702293238183.png

     

    I

     

     

  • takolota1 Profile Picture
    4,980 Moderator on at

    @askingquestion9 

    I don’t know what you’re doing, but that looks like an unnecessary Apply to Each loop on the Lines when you need to use a Filter array action. 

  • askingquestion9 Profile Picture
    32 on at

    @takolota I managed to get it  to work but it doesn't seem optimal

     

    askingquestion9_0-1702372304793.png

     

  • JStell Profile Picture
    12 on at

    @takolota, would you be able to help with how to reference the specific lines? For instance, after you see "body":[ which leads down to "lines": [, how would I reference the specific call outs below this point in order to pull the desired information? Would each instance of open and closed brackets following this be considered an idividual line? Let me know if this doesn't make sense so I can try and re word it.

     

    "body": [
            {
                "@odata.type": "#Microsoft.Dynamics.CRM.expando",
                "page": 1,
                "lines@odata.type": "#Collection(Microsoft.Dynamics.CRM.crmbaseentity)",
                "lines": [

     

     

  • takolota1 Profile Picture
    4,980 Moderator on at

    @JStell Can you share more of the output? Like maybe paste it into a text file & attach it?

  • JStell Profile Picture
    12 on at

    @takolota, I'll attach the output here. I removed the irrelevant information leaving on the text that I would like to extract. It is in the Format of Title then Text to be extracted. For example, the first one you will see is "text": "QC Package ID#" which would be the title of the field, followed by "text": "SW-001" which would be the extract value. In total, I have 8 fields I would like to extract.

  • takolota1 Profile Picture
    4,980 Moderator on at

    @askingquestion9 & @JStell 

    Here is a picture that I think may help better answer the original question of the thread asking for the lower-left quadrant

    ExampleSelectLowerLeftQuad.png

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

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 227

#2
David_MA Profile Picture

David_MA 204 Super User 2026 Season 1

#3
Valantis Profile Picture

Valantis 177

Last 30 days Overall leaderboard