Hello,
I want to count length in column Create ID by use if condition
If CurrentRow(“Create ID”).Tostring.Length<7
remark
But error : Object reference not set to an instance of an object.
I debug run output as below.
![]()
Please guide me for solve it.
Hello,
I want to count length in column Create ID by use if condition
If CurrentRow(“Create ID”).Tostring.Length<7
remark
But error : Object reference not set to an instance of an object.
I debug run output as below.
![]()
Please guide me for solve it.
@Parvathy yes, some row empty cell
When the value of the column will be null or empty it will throw this error.
Try checking if it’s null first.
CurrentRow(“Create ID”) IsNot Nothing AndAlso Current Row(“Create ID”).Tostring.Length<7
Thanks,
Ashok ![]()
Hi @fairymemay
Try the below condition in If then:
If
Not String.IsNullOrEmpty(CurrentRow("Create ID").ToString()) AndAlso CurrentRow("Create ID").ToString().Length < 7
Then
' Add your logic here (e.g., set a remark or update a column)
End If
Hope it helps!!
Hi,
If you want to handle empty (null) as 0 length, the following will help you.
Current Row("Create ID") is Nothing OrElse Current Row("Create ID").Tostring.Length<7
Regards,
Now error as below.

Please put Current Row(“Create ID”) is Nothing first, then connect with OrElse
@Yoichi Same error as below.
I have 3 condition in if condition

Hi @fairymemay
Check whether Create ID column name has any trailing spaces at the End,and try the below condition:
If
Not String.IsNullOrEmpty(CurrentRow("Create ID").ToString()) AndAlso CurrentRow("Create ID").ToString().Length < 7 AndAlso CurrentRow("Create ID").ToString.Equals("ESPGADMIN")
Then
' Add your logic here (e.g., set a remark or update a column)
End If
Regards
@Parvathy why use andalso in 3 condition ?
If morethan 1 condition I want go to then.
Please guide me for solve it.
Thank you.
Hi @fairymemay
Do you want the condition to go to then even if one of the conditions satisfy. Please specify.
Regards
@Parvathy I have 3 condition
but If true condition (some or all condition) go to then

Hi @fairymemay
Can you share your excel file with all conditions. I will help you with flow.
Regards
@Parvathy Example file as attached.
input.xlsx (8.0 KB)
Give me some time. I will help you with flow @fairymemay
Regards
@Parvathy Yes delete row in excel input that match condition.
String.IsNullOrWhiteSpace(row("Create ID").ToString) OrElse row("Create ID").ToString.Length < 7 OrElse row("Create ID").ToString.Equals("espgadmin", StringComparison.OrdinalIgnoreCase)
Hope this works for you
=> Read Range Workbook

Output → dt
=> Use below syntax in Assign:
FilteredDt = (From row In dt.AsEnumerable()
Let createId = row.Field(Of Object)("Create ID").ToString()
Where Not (String.IsNullOrEmpty(createId) OrElse
(IsNumeric(createId) AndAlso createId.Length < 7) OrElse
createId.ToUpper() = "ESPGAMIN")
Select row).CopyToDataTable()
FilteredDt is of DataType System.Data.DataTable
=> Write Range Workbook

Hope it helps!!