Receipt and Invoice AI - Now available in Public Preview!

Hi Team,

any one facing this issue.
after using action triggers, bot forget value of local variable

i am looping through the directory.getfiles in for each

after first iteration, when i resume the process
in next iteration, it says object reference not set instance of object

P.S : there are 4 files in that directory.

3 files are still left

in for each loop,
i have Digitize document,
then write line
then classifying my doc
Present Classification Station
Train Classifiers Scope
Data Extraction Scope
Create Document Validation Action
Wait For Document Validation Action And Resume
then export result

all these activity works fine in first iteration, but in next iteration bot forget the files

execution is good till action comes from orchestrator

now the action is completed form orchestrator

now i will resume my workflow

here i am also checkking the count of files present in rhat directory again
result = 4 means it identifiles there are total 4 files

it complete the first iteraction and exports the result for that document
now it again goes back to main for each loop where it have to take next document but it forget the value and gives this error

please suggest ASAP so that i can overcome the issue.

thanks in advance

gpal

1 Like

did you find any resolution??
I am facing this same issue, I have two files in the folder after looping for the 1st files its giving this same error

@loginerror
@Pablito
if you can, please help me verify whether its a bug or what??

For Each: Object reference not set to an instance of an object.

RemoteException wrapping System.NullReferenceException: Object reference not set to an instance of an object. 
   at UiPath.Core.Activities.ForEach`1.InternalExecute(NativeActivityContext context,
IEnumerator valueEnumerator)
   at UiPath.Core.Activities.ForEach`1.GetStateAndExecute(NativeActivityContext context,
ActivityInstance completedInstance)
   at System.Activities.Runtime.ActivityCompletionCallbackWrapper.Invoke(NativeActivityContext context,
ActivityInstance completedInstance)
   at System.Activities.Runtime.CompletionCallbackWrapper.CompletionWorkItem.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)

the error states there is something wrong with your For Each , not the DU framework pieces. Maybe try to rename Document to something else - it is a class of the DU framework…

@loginerror thank you for your reply, I tried with parallel for each, and worked perfectly with the same files.

1 Like

I am facing the same issue with for each, so I tried parallel for each but getting error: The automatically determined extracted results references do not match the Document Object Model. They may have been created using a different Document Object Model.

Is it because parallel for each trying to create two DOM at same time?
Can you please help me how you resolved this issue?

1 Like

I am using Parallel ForEach because I am using Action Center instead of On-Prem Validation Station, see my screenshot above.

I tried using Parallel For each loop with Action center validation and it worked fine for 10 document, when I tried with 50 documents I am getting β€œUnexpected Error” in logs.
May I know is there any limit for processing document in parallel?

How many documents you have tried in your solution?

My document count is very less, but you mast try to debug to drill down the main cause and even you can post your issue in forum, there are many experts who can help you just post it on right track.

Thank you, also how do you write extracted result in excel inside parallel foreach loop?

I am attaching a .xaml file for your reference you can change it as per your requirement.
Flowchart.xaml (86.9 KB)

Thank you, my work flow is same as well, now only problem, is if I give more than 20 documents its throwing unexpected error.

Hi @anto.santhosh can you provide more details about the error? A copy paste of the error details, and also a screenshot would help.

Also, what format are the 20 documents? (pdf, tiff, etc) How many pages does each of them have?

Thanks,
Alex.

I have made seperate post about this issue.
Please find below the details. The document is of pdf format. Each document will be between 1 to 4 pages max.

I am trying to Digitize document using OCR for more than 20 documents using parallel for each since Action center doesnt work in normal for each.
While Digitizing document I am getting Unexpected Error when documents are more, may I know what is the limitation of using ocr in parallel or this error is due to some other reason. I have tried with Uipath ocr, google, ocr, omnipage and Tesseract, all throwing same error.

Please find below the error message:
RemoteException wrapping System.Exception: An unexpected error has occurred β€”> RemoteException wrapping System.AggregateException: One or more errors occurred. β€”> RemoteException wrapping UiPath.SmartData.Digitization.Tokenization.TokenizationException: 394_CUCF00048_394_3216649_AM3.pdf_Page_1 β€”> RemoteException wrapping System.Exception: Error performing OCR: OperationCancelled β€”> RemoteException wrapping System.ServiceModel.FaultException: OperationCancelled
at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation,
ProxyRpc& rpc)
at System.ServiceModel.Channels.ServiceChannel.EndCall(String action,
Object outs,
IAsyncResult result)
at System.ServiceModel.Channels.ServiceChannelProxy.TaskCreator.<>c__DisplayClass7_0 1.<CreateGenericTask>b__0(IAsyncResult asyncResult) at System.Threading.Tasks.TaskFactory 1.FromAsyncCoreLogic(IAsyncResult iar,
Func 2 endFunction, Action 1 endAction,
Task 1 promise, Boolean requiresSynchronization) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at UiPath.Vision.VisionClient.<ScrapeAsync>d__5.MoveNext() --- End of inner exception stack trace --- at UiPath.OCR.Activities.UiPathDocumentOCR.EndExecute(AsyncCodeActivityContext context, IAsyncResult result) at System.Activities.AsyncCodeActivity 1.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context,
IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.IntelligentOCR.Digitization.ExtendedOcrEngineActivityWrapper.d__2.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.SmartData.Digitization.OCR.OcrTokenizer.d__7.MoveNext()
β€” End of inner exception stack trace β€”
at UiPath.SmartData.Digitization.OCR.OcrTokenizer.d__7.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.SmartData.Digitization.PDF.PdfTokenizer.d__13.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.SmartData.Digitization.PDF.PdfTokenizer.d__11.MoveNext()
β€” End of inner exception stack trace β€”
at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
at System.Threading.Tasks.Task 1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task 1.get_Result()
at UiPath.SmartData.Digitization.ContentTokenizer.<>c__DisplayClass8_0.b__0(Task 1 t) at System.Threading.Tasks.ContinuationResultTaskFromResultTask 2.InnerInvoke()
at System.Threading.Tasks.Task.Execute()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.SmartData.Digitization.DocumentDigitizer.<>c__DisplayClass16_0`1.<g__AttachContinuation|0>d.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.SmartData.Digitization.DocumentDigitizer.d__14.MoveNext()
β€” End of stack trace from previous location where exception was thrown β€”
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.IntelligentOCR.Activities.Digitization.DigitizeDocument.d__34.MoveNext()
β€” End of inner exception stack trace β€”
at UiPath.Shared.Activities.AsyncTaskNativeImplementation.BookmarkResumptionCallback(NativeActivityContext context,
Object value)
at UiPath.Shared.Activities.AsyncTaskNativeActivity.BookmarkResumptionCallback(NativeActivityContext context,
Bookmark bookmark,
Object value)
at System.Activities.Runtime.BookmarkCallbackWrapper.Invoke(NativeActivityContext context,
Bookmark bookmark,
Object value)
at System.Activities.Runtime.BookmarkWorkItem.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)

Hi Team,

Not sure if this is the right place to post the question. I have a use case to solve probably you can help.
I have folder with different types of invoices , also probably in various languages.
Now what i have to find is if two invoices are similar interms of contents. if yes then flag it which one’s are. ideally if i have 10 invoices then there is a combination of comparison which will occur to finally say which ones are similar. how can i go about it please?

thanks

Hi there,

try replacing your for each with parallel for each, it should resolve the issue.