Invoke code activity error: Invoke Code: Exception has been thrown by the target of an invocation

I ma using Invoke code activity and getting error as : Invoke Code: Exception has been thrown by the target of an invocation…

Below is the code I am using inside the activity:

Can Someone please help with this?

@ayushi_jain3

Please open the exception details from the locals panel when the error happens…in it you will see the exact exception

Check if you have passed all the required arguments

And you can actuall do this using assign and if activities

Cheers

Hi @ayushi_jain3

Exception has been thrown by target of invocation - error occurs if the value goes null to the variable.

Check for any null values assigned/passed.

Check the values assigned to the argument.

Hi @ayushi_jain3 ,

Could you also maybe try as per the Suggestion provided in the below post :