Update row in a data table is not working

Hi,

I am trying to update row ans its not updating the value i am passing

Attached is the screenshot. Can someone help here please?

Hi,

Can you try to use the following expression in condition of if operator?

row.Item("Comments") isnot Nothing AndAlso not String.IsNullorEmpty(row.Item("Comments").ToString())

Regards,

@Krithi1,

Try using the condition like this:

If(IsDBNull(row("ColumnName")) OrElse String.IsNullOrEmpty(row("ColumnName").ToString()), "Empty column values", "Got the values")

@ashokkarale

I assigned this statement into a variable but its coming out as null

@Yoichi

I don’t see the value that I need to replace in this query. Seems like the query is checking only if the value is null?

@Krithi1,

That’s weird. It should return either “Empty column values” or “Got the values”. Can you share screenshot how you are using.

@ashokkarale

Hello,
Write something there :

@bruno40

Comments are empty right now. If I understand it right, I am trying to replace the null value with the text “phone number and email exist.” Is that not the right understanding?

@Krithi1,

No this will not replace the null value. The logic will only tell if the column is empty or not.

If you want to replace the null/empty/blank values with phone number and email exist. use this logic in Assign activity.

row("Comments") = If(IsDBNull(row("ColumnName")) OrElse String.IsNullOrEmpty(row("ColumnName").ToString()), "Phone number and email exist.", "")
1 Like

It depends on what you want :
if(condition, condition is true, condition is false)

if(String.IsNullOrEmpty(row(“Comments”).ToString), “it is empty”, “there’s something”)

Hi,

My intent is as the following. Can you try this?

if(row.Item("Comments") isnot Nothing AndAlso not String.IsNullorEmpty(row.Item("Comments").ToString()), row.Item("Comments").ToString(), "Both Email and Phone Number exists")

Regards,