Operator is

Hi all,
i’m a rookie and i’ve a question.
The expression is
datiExxcel.Rows(numeroRighe)(“gender”) is “Male” where datiExxcel is a data table created by an excel file. Why when he find “Male” in the excel file he go always in “else” of expression and therefore check the female box?

Thanks in advice

2 Likes

Hi
Welcome to uipath community
Kindly try with this expression
datiExxcel.Rows(numeroRighe)(“gender”).ToString.ToUpper.Trim.Contains(“MALE”)

Make sure that numeroRighe is variable having the row index of int32 datatype
As the syntax is
Yourdatatable.Rows(rowindex)(columnindex)

Hope this would help you
Cheers @andreus91

1 Like

Is still not working, now click always on “Male”.
DatiExccel is the data table output of a Read Range operation.
I’ve checked the box “AddHeaders” and “gender” is the header of the excel file i want to check

@andreus91 Follow this steps

1)Use lookup range activity and pass value as Male this will store output in string variable assume V1
2)Check if V1 is empty or not
If(String.IsNullOrEmpty(V1))
{
//Female
}
Else
{
//Male
}

I don’t know if i do well but is wrong!

@andreus91 Use excel application scope and use read range,lookup activity inside excel application scope