Get queue item - empty values

Hello,

Can anyone help with the following? When I am using Get Transaction Item (to get items from the Orchestrator) I am using Assign to get populate variables with Specific Transaction Data. Because of where I am getting my load queue data from some of these values will sometimes be empty.

This throws an exception ‘NullReferenceException’ and stops the process. I would like if this exception is thrown for the bot to just get the next item or even to try to process the item with the empty values. I have wrapped the Assign activities in a Try catch but this still doesn’t seem to work

then you will need one of 2 things, use IF condition to check if is null before each assign OR use a try catch for each assign activity…

@Bob2

You can make an expression for the assigned value to evaluate your object. I’m assuming the items that are sometimes empty are the SpecificContent from the transaction; i.e. the fields in the queue may or may not be present from time to time.

With this assumption, you can check to see if the key exists in the current duictionary:

If (OutTransactionItem.SpecificContent.ContainsKey("ClientDate"),OutTransactionItem.SpecificContent("ClientDate").ToString,"CUSTOM_SECTION")

This will return the transaction data if it exists, if not, then it returns whatever you have in the CUSTOM_SECTION

*Note, this should all be on 1 line in the Expression section of the Assign Activity

1 Like

Thanks for your response @sagacity.

I tried you solution but it still throws and error for an empty string.

Which activity is throwing the error? An empty string shouldn’t throw an error at all (because you can assign a variable a NULL value) let alone using this code. It seems like the error might be occurring somewhere else.

Estoy teniendo el mismo problema que Bob2 y no consigo manera de resolverlo.

TransactionItem.SpecificContent(“xxx”) is Nothing

is solution.

4 Likes

TransactionItem is Nothing, worked for me.

This is the solution :slight_smile: How to list all values in a queue item?