How to read a null values from excel

I have stored my Excel file in orchestrator. from there i am reading values from excel. now i want to read the null values and throw exception.

I am using this
NOT string.IsNullOrEmpty(in_TransactionItem.SpecificContent(“Name”).ToString)
but its not throwing exception for null values.

That line alone will not throw an exception. If you want to throw an exception, you can put that condition in an If activity, and in the Else section, add a Throw activity.

1 Like

i have used if condition. below is the screenshot for your reference.

If there are any spaces in the “FirstName” field, that will not be null or empty. Step into the code and see if there is something like that in the content.

No space in FirstName.

Can you show me where the process goes when you use Step Into for that value? Curious to see what path it takes when the value is blank or null.

Also, if you can provide a screenshot of what that specific content is set to from the Locals panel, that will help.

It will read that empty value and it will fill in application.
image .
When First Name is empty it should throw exception but its not throwing

I mean in Studio, not the application itself.


Hi @sweety,

Can you try using Trim and see if it will still proceed? It should look like this:

NOT string.IsNullOrEmpty(Trim(in_TransactionItem.SpecificContent(“FirstName”)……)

Thanks alot. its working:-)

1 Like

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