Object not set to reference of an object

I am getting an error as object reference not set to instance of an object while processing invoices using action center in orchestrator for each loop activity.

Can Anyone please help me with this error?


“Object Not Set to reference of an Object” Usually this exception comes if you are passing null value to For Each

So check the value is not null, Also check you have set the correct Foreach Type Arguments from Properties

Hope this helps


I have ste the properties as object for for each activity
image and I am passing default value to it


Check as below

I am getting correct results, Check if there are files in Folder you have mentioned

Hope this helps


@Srini84 yes there are files in my folder and i am trying to process each file using for each activity but i am able to process only one file not the other files

can u please help me with this issue?


Can you try by passing full file path and check

Hope this helps


Also I am using orchestrator template to create the workflow as I am trying to get those files in orchestrator in action center

full file path as in?


Full folder path


no this did not help

@Srini84 no this did not help

I have seen that happen in following situations:

  1. You are using an object that has not been initialized
  2. It has been initialized but the type does not match your use. For example, your object definition is


but your usage is

int32 or String,String


In your case, it appears to be #2.

I’ve seen this happen when using the action center. If you are using “Create Document Validation Action” and “Wait For Document Validation Action And Resume,” this error will occur. The reason is that when UiPath suspends while waiting for the user to take the action, UiPath effectively ends the process and clears all of the variables (including the loop variables). When it starts up, the loop variables are null hence the error.

To resolve, try a “parallel for each” instead of the standard “for each.”

1 Like

ok thanks I tried and now my workflow has no error But now i am able to process only one invoice . In the action center the task gets created only for one invoice and not the other one can u please help me with this issue?

I’m happy to take a look at the workflow if you can attach it. There are a lot of variables that may be in play.

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