Can not assign QueueItem.SpecificContent("xxx").ToString to stringname

I have the above strange issue here whereby I am trying to retrieve some specific data tagged into a queue item into a string variable.

This particular specific data key is definitely there in the queue item but the value of it is “null”.

So InvalidOperationException error occurs when Orchestrator tried to assign this key item to a string variable and I have no idea why is that happening.

Interesting thing to note, when this specific data item is an “empty” instead, there’s no such issues.

So not sure if this is a bug or what, but I can’t find any solution to this issue also.

Hey,

Before assigning your specific content value to a string, please have a if condition where it check whether it is having some value as below:

if(in_TransactionItem.SpecificContent(“xxx”) is Nothing)
then yourStringName = Empty
Else
YourStringName = in_TransactionItem.SpecificContent(“xxx”).Tostring

InvalidOperationException occurs when you are trying to convert a null value to string, on the other hand Empty value is also considered as String which is why error will not occur for a empty string

Regards,
Rajeswari

Assign Activity

strMyValue = 
If(isNothing(YourTransactionItem.SpecificContent("YourKey"), "", YourTransactionItem.SpecificContent("YourKey").toString

feel free to assign any other string for the null case e.g. String.Empty, nothing, “Undefined”…