Check is Transaction specific content is null or empty

Hello all.
I want to check if a specific content in null or empty from studio.
I have used this code String.IsNullOrEmpty( queueTransactionItem.SpecificContent(“Name”).ToString)

But getting error lMessage Box: Object reference not set to an instance of an object.

Hi @Dinesh_Babu_S

The variable you are using is getting to be null. Please check the same and better to run the bot in Debug mode then it will be more clear which activity and variable is getting null.

Cheers!!

1 Like

check if the SpecificContent is null:
isNothing(queueTransactionItem.SpecificContent)

Check if SpecificContent contains the key:
queueTransactionItem.SpecificContent.ContainsKey(Name)

Check if Name is NullOrEmpty

isNothing(queueTransactionItem.SpecificContent("Name") OrElse String.IsNullOrEmpty( queueTransactionItem.SpecificContent("Name").ToString.Trim)

Feel free to chain it within a cascade

1 Like

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