Reading null when its in there queue item

Hello all i have some nulls in the transaction item
how to Skip or assign value if its null !
i have done this
string.IsNullOrEmpty(in_TransactionItem.SpecificContent[“REM_INFO”].ToString().ToString().Replace(“\r\n”, “”).Replace(“\n”, “”).Replace(“\r”, “”)) == false

but still facing same issue

Test with:

!String.IsNullOrWhiteSpace(in_TransactionItem.SpecificContent["REM_INFO"])

we can cascade:

  • isNothing(in_TransactionItem.SpecificContent)
    • SpecificContent is Null
  • Not in_TransactionItem.SpecificContent.ContainsKey(“REM_INFO”)
    • SpecificContent does not have the Key
  • and can check if the value from SpecificContent.(“REM_INFO”)
    • is null
    • or if it is not null then is an empty string, by also triming it before checking

@Hazem_Saleh,

You can check/skip the transaction item by this condition:

in_TransactionItem.SpecificContent Is Nothing

Thanks,
Ashok :slight_smile:

Thanks all i replaces my query to avoid this,

But can someone tell why when assign global variable UiPath freez!

I have a variable want to assign one time! during the process !

image

Try this one :
remInfo(string) = in_TransactionItem.SpecificContent?[“REM_INFO”]?.ToString()?.Replace(“\r\n”, “”)?.Replace(“\n”, “”)?.Replace(“\r”, “”);

if (!string.IsNullOrEmpty(remInfo))

We recommend to to scope 1Topic = 1 case
As the topic started with the question about the null check, so lets stay with this only

have a look at the Data Manager and configure the variable settings e.g. the scope to Global

1 Like

I understand that,
I opened new Topic

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