cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
johnjohn123
Post Prodigy
Post Prodigy

Can we skip a loop incase we get the documents we want to scan to save licenses

We need to loop through a PDF which contain 15 pages, and we are only interested in scanning 2 pages of them, but those 2 pages will have random position. so now i will define a loop and run AI Form Processing model on each page, such as the approach mentioned here @ https://docs.microsoft.com/en-us/ai-builder/form-processing-model-in-flow#page-range>> now on the happy scenarios is that the first 2 scanned pages will be the ones we are interested in,, so we can exit the loop so we do not need to scan the remaining 13 pages to save our scanning licenses.

But is there a way to skip a loop in power automate? or we will always have to scan the 15 pages?

9 REPLIES 9
eric-cheng
Solution Sage
Solution Sage

Hi @johnjohn123 ,

 

Looks like you can specify the page rsnge to process as a string.   

 

Screenshot_20210722-230541_Chrome.jpg

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

@eric-cheng  Yes i know but as i mentioned the 2 pages we are interested in will have a random position, so we can not know in advance the page ranges unless we scan the PDF .. did u get my point?

We need to do so as the AI has a license calculator @ https://powerapps.microsoft.com/en-us/ai-builder-calculator/ . so to have a more efficient use of the licenses , if we can skip scanning the renaming pages once we scanned the needed 2 pages...

Hi @johnjohn123 ,

 

Maybe have a look here and see if you can break out of the loop if a condition is true i.e. form fields extracted.

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Hi,

One option would be to first OCR your document with Text Recognition https://docs.microsoft.com/en-us/ai-builder/flow-text-recognition to get the raw text. this model is way cheaper (25x) than Form Processing.

You would parse the text to find a pattern that will give you the starting page.

Then you will use Form recognizer with identified page number and the page range feature to analyze the relevant pages. 

Hi @johnjohn123 ,

 

Sorry, I re read your post.  It looks like you may need to split your PDF into pages first.  As there isnt an ootb way of doing this, you will need to weight the cost / benefit of a custom connector.

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

@CedrickB  to be honest this will over complicate the flow... i will follow it only if i can not use other approaches... also i am not sure if  Text recognition will allow us to know at which page the pattern exists ..

@eric-cheng  no i do not need to split the pdf i need to loop through its pages only

Hi @johnjohn123 ,

 

You have a 12 page PDF which you dont want to process all 12 pages but dont know what page range to process as its random.

 

The link you provided will require you to pass all 12 pages in one go to AI builder and "after" its processed all 12 pages, you can loop through the results.  I dont see how you can achieve your outcome without first splitting the pages and checking the result before scanning the next page?

@eric-cheng  for example if the first 2 pages contained the pages we are looking for then we can be sure that we do no need to scan the other pages..

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Kudoed Authors
Users online (2,200)