I have a string that contains null values in some places,i was preparing a datatable and was calling that in for each row,But in If-THEN i am not able to figure out what to write to tell that in case of null values for Sqft variable it should just print 0

I have a string that contains null values in some places,i was preparing a datatable and was calling that in for each row,i then took an IF condition where i wrote in condition- String.IsNullOrEmpty(CurrentRow(“Sqft”).ToString) ,But in THEN i am not able to figure out what to write to tell that in case of null values for Sqft variable it should just print 0

Hi @ShivamDumka

Welcome to the UiPath Community

Can you show us some example of input String and the output String

Hi @kumar.varun2 good morning,do you mean like according to my project i need to show you the string for which i have null values?
If so,then actually there is a datatable that contains a column called “Sqft” and so is the name of the variable when i am calling it in the “buildDataTabel” activity,in this i am scraping the data from a website from edge browser,so in website there is a value getting scaped called Sqft,but i havent handled the scenerio where in website also has this value as null,means in the website they havent given the value.
Can you please help and if any more info required i will provide you.

If it is null then simply use

Sqft = ""

or

Sqft = String.Empty

So can you tell me in my sequence how can i put it,i will paste the screenshot of what i have done,i am actually in learning phase and have been acquainted with UIpath from last 5 days only

What is the variable type of Sqft variable?
if is double then simply use

Sqft = 0

image

Yes so it is double,so you mean in “assign”,because i think condition is fine right in IF?
Condition-String.IsNullOrEmpty(CurrentRow(“Sqft”).ToString)

in THEN:
Sqft=Convert.ToDouble(CurrentRow(“Sqft”).ToString.Replace(“sqft”,"").Replace(",","").Replace("–",“0”).Replace(" ",“0”).Trim)

what change in this “THEN” statement can i do?

Just directly i can aasign sqft=0 you mean right inside if block?

yes.

Sure Varun,will do this once and if any error i will get back.

Thanks a lot for this quick response and help.

@ShivamDumka

Is your problem solved?