Skip to main content

Notifications

Power Apps - AI Builder
Answered

Extracting coordinates from AI Text Recognizer in a collection

(0) ShareShare
ReportReport
Posted on by

so im working on an app to extract coordinates of text from the text recognizer and here's my code:

 

Set(X, TextRecognizer.Results);

ClearCollect(Cords,{});
Collect(Cords, {Values: X});

 

but this gives me a nested collection with all of it in an array and then box coordinates in another one. I want a tabular format where i get the text and left , height , top and width in seperate columns. Is there any way to do that as i wanna import it to excel using

Toexcel.Run(JSON(Cords,JSONFormat.IncludeBinaryData))

 

which works but its all in one cell.

for example i want the result to be:

 

TextLeftTopWidthHeight
a1234
b1234

 

Categories:
  • Verified answer
    Antrod Profile Picture
    Antrod on at
    Re: Extracting coordinates from AI Text Recognizer in a collection

    Hi @Anonymous ,

     

    It seems to work with this code:

    Set(X, TextRecognizer1.Results);
    Clear(CordsFinal);
    ForAll(X, Collect(CordsFinal, {Text: First(X.Text).Text, Left: First(X.BoundingBox).BoundingBox.Left, Top: First(X.BoundingBox).BoundingBox.Top, Width: First(X.BoundingBox).BoundingBox.Width, Height: First(X.BoundingBox).BoundingBox.Height}));
     
    Let us know if that helps!

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,526

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,907

Leaderboard