Anchor Base: Object reference not set to an instance of an object

I’m working on the RPA Challenge project, and inside the Process.xaml I have an Anchor Base activity where:

  • Anchor: Find Image (label “First Name”)

  • Target: Type Into (First Name input box)

  • Text: in_TransactionItem.Item("First Name").ToString

When I run the process, it throws the above error.
I have attached a screenshot of the workflow for reference.

I already tried:

  • Validating both selectors

  • Reindicating both elements

  • Adding delays

  • Making sure the image and field are visible on screen

But still, the error persists.

Can anyone help me understand what might be causing this “Object reference not set to an instance of an object” inside the Anchor Base?

1 Like

hi, @S_Yuvaraj ensure the argument is correctly assigned and contains “First Name” before the Anchor Base runs

edit - or also you can Add a check: If in_TransactionItem IsNot Nothing AndAlso in_TransactionItem.Item("First Name") IsNot Nothing before type into.

@arjun.shiroya @S_Yuvaraj As you can see in the local panel, the argument in_TransactionItem is null can you recheck the *Invoke Process * argument panel to ensure that a value has been assigned to the in_TransactionItem argument

Hi,
That usually means the issue isn’t with the Anchor Base itself, but with the input value. Most likely, in_TransactionItem is Nothing (null) or it doesn’t contain the column “First Name.”

Try adding a Log Message before the Anchor Base with: in_TransactionItem?.Item(“First Name”)?.ToString

If it logs blank or throws an error, confirm that:

The variable in_TransactionItem is properly assigned from your TransactionData (for example, TransactionItem = dt.Rows(CurrentIndex) in GetTransactionData.xaml).

The column name matches exactly (case and spacing) with the Excel headers or source data.

In short, your Anchor Base is fine, the null reference is coming from the missing or uninitialized in_TransactionItem.

Check if the transaction_item variable is holdinig a value

@S_Yuvaraj

in_Transactionitem is null so you are getting this issue

in invoke process check if the argument is linked to a variable to send the value

cheers