How do I skip over an expected null entry in a data table?

Hello all, (I’m still quite new to this so sorry if this is a dumb question)

I am currently running a bot which scrapes varying datatables from webpages (they have customer information) and some tables have entries which others don’t. I have to output these as a ‘dictionary’ to log them, but the bot falls down if the entry is missing.

Eg: when it goes to log ‘company name’ it fails if the customer is independent and not of a company.

How would I skip over this to keep going? Ideally, I’m going to write this to a JSON file which is going to be sent to a server when all is complete.

Thanks for your help.

@dr1992

You can try either of the method.

  1. Check the value whether it is Null or not before assigning it to dictionary.

  2. Enclose that assign activity in Try Catch block to ignore that exception.

Hey Lakshman, how do I check if it’s null? I’ve set it to be assigned to a variable but it still errors if null aha.

Thanks in advance!

Hi @dr1992!

you can check if a variable (or a DT Value) is null by using the following:

String.IsNullOrempty("YourString")

→ Replace “yourString” with your variable and ready!

this will output True if null or empty, False if it contains data!

2 Likes

@dr1992

Use below condition in IF activity to check whether value is null or not.

         String.IsNullOrEmpty("String Value")
          Then 
              Value is empty
           Else
               Value is not empty and you can use Assign activity here
1 Like

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