Object reference not set to instance of an Object UiPath
This is a pretty common error or issue that usually pops up whenever we are designing the workflows.
There were several reasons why this error Object reference not set to an instance of an object comes are listed below:
- The null value of variable or argument
- A null value for any activity from which you are getting the text from any website.
- Maybe you have created duplicate variables.
- Import arguments are not updated.
Null Value from Variables or Arguments:
This very usually happens when we forget to provide value for a variable or argument which needs a default value.
That is used in conditional statements as shown below:
This is also one reason of getting this error.
Firstly, check all your variable and argument values that are used in that workflow.
Output from an Activity:
While we are working with web automation a lot of times we need to get the data from the website and store it somewhere.
While doing this we may also need to check some conditions before storing.
This is the area where we use the if condition and this error may arise because the output value is null.
This might be the second reason or this error.
Duplicate variables in the workflow:
While designing the automation workflows we will create a lot a variables.
We always don’t see the scope of the variable and create the same variable in another scope.
When we are running the whole workflow we tend to believe it has the correct value but when it comes to that scope the value becomes null.
The second variable doesn’t have any value, so it gives an object reference not set to an instance of an object error.
Import arguments are not updated:
Whenever you are modifying some arguments in a workflow and you saved the workflow.
Then you need to update the arguments in the main workflow.
If you don’t update the import arguments it looks like below:
These are some of the reasons why we receive this error in UiPath Studio.