A loop for digitizing document a series of document in a file

This might be simple, please excuse my inexperience.

I want to create a workflow that fetches a document(.png) from a folder of 20 similar documents to perform Document Understanding by an OCR engine. Then it loops itself to perform document understanding for other documents in the file until the OCR reads all.

Anyone can share their thoughts or a template to do this? I understand how to create a document understanding workflow for a single document, but I really have no idea how to make the loop part.

Hi @Ben_siu

  1. You can have an variable type Array Of string and Read all the files from the Input Folder folder

Arr_InputFilePath = Directory.GetFiles( In_str_InputFolderPath)

image

Where In_str_InputFolderPath is the Input Folder Path

  1. Have a For Each Activity to Loop through all the files, and use Document understanding Flow inside it by passing the value of “Item” as Input Path to DU Activities.

image

Thanks.

1 Like

Thanks for your reply!

It seems that this workflow will have a problem. Under the for each loop, in the body part, I have to put a digitize document activity, which requires the exact location of a document. So the InputFilePath cant be looped in the digitize document activity.

can you please try passing “Item” in “Document Path” Field in Digitize Document Activity.

Also please make the Argument Type of For Each Activity to “String”.

image

Thanks

1 Like

seems to be running now!!! Thank you so much!!!
Also would it be possible to write each document on a separate notepad(.txt)? I discovered that the texts are being overwritten and that the final product is just the digitized version of the last document in the file.

Yes , you can have the Filename as the name of your notepad.

you can have the file name by using

path.GetFileName(item)

image

and pass the Filename variable.

thanks

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.