in_TransactionItem.SpecificContent("Test1234").Tostring is giving me "Object reference not set to an instance of an object" error

in_TransactionItem.SpecificContent(“Test1234”).Tostring is giving me “Object reference not set to an instance of an object” error

I tried

IsNothing(in_TransactionItem.SpecificContent(“Test1234”).Tostring)
in_TransactionItem.SpecificContent(“Test1234”).Tostring Is Nothing
in_TransactionItem.SpecificContent(“Test1234”).Tostring = Nothing
in_TransactionItem.SpecificContent(“Test1234”).Tostring = “”

no luck on anything I tried so far. Any suggestions?

Hi @Krithi1 ,

Can you please share a snap of transaction details pop up from orchestrator for any one transaction item.?

Thanks,
Gautham.

@Krithi1
That means in your queue item (in_TransactionItem), there is no such key for “Test1234”, or even the queue item is empty.
You may log message with ‘in_TransactionItem’ to check.

@healsko_ho

It does have the key…

But i didnt understand your suggestion, can u please elaborate

Hi @Krithi1

What are you trying to extract from the transaction item. Is there a specifics field as per your syntax the key Test1234 does not exist in your transaction item so it’s throwing an error

Regards

I used “Test1234” jist ti explain my problem

I am actually trying to get value for “Direct/Indirect Hire”

When its null, i need to throw a business exception and move on to the next transaction.

Its simple… if the value is null, i need to throw business exception and send email, else i need to enter the value.

Hi @Krithi1 ,

“Test1234” is not in your screen shot. According to the snap you have shared , using specific content you could extract, [FirstName,MI,Grade/Rank,Direct/Indurect Hire, Gender] values.

If you have “Test1234” just like the ones in above list.

Try to match the spelling , case of the characters(Uppercase lowercase), space if any etc…,

If the detail is there in transaction item then only you would be able to extract the value.

Thanks,
Gautham.

@Gautham_Pattabiraman

Can u plz read my above comment?

Also, I literally copied the key from the orchestrator.

Hi @Krithi1 ,

Please Try using this expression,

String.isnullorempty(in_TransactionItem.SpecificContent(“Direct/Indirect Hire”).Tostring)

Note : Typing from mobile , please check the spelling once.

Hope this helps you out.

Thanks,
Gautham.

I tried that already, it didnt work

Hi @Krithi1 ,

Please try this if already not tried,

String.isnullorempty(in_TransactionItem.SpecificContent.GetValueorDefault(“Direct/Indirect Hire”).Tostring)

Hey @Krithi1

Try this one:

in_TransactionItem.SpecificContent.GetValueOrDefault("Direct/Indirect Hire").ToString.Equals("")

Above query will give you output as True or False, you can use it in If activity directly!

In then body:

You can Throw BusinessException!

Else: As per requirement!

Regards,
Ajay Mishra

Hi @Krithi1 pls refer the below link…

1 Like

@Krithi1,

This is the issue & solution @Akhil_Nukala mentioned. There are recent update to GetQueueItems activity which will return SpecificContent & Output as null.

Thanks,
Ashok :slight_smile:

1 Like

Hi @Krithi1,

I believe you would require to first check if the value is Nothing and then check if whether the value is empty as well like below :

in_TransactionItem.SpecificContent("Test1234") is Nothing OrElse String.IsNullOrWhitespace(in_TransactionItem.SpecificContent("Test1234").ToString)

The above condition should check for both Null and Empty string values.

IsNothing(in_transactionitem.specificcontent(“test1234”)) worked

Converting it to .Tostring was failing.

Ty so much everyone.

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