If activity and check box

I need to check a checkbox according to true or false value in excel row. But whatever I do, it goes to else part only.

Secondly, I’m facing issues in Radio buttons. I have 3 radio buttons, and after checking in excel row it is supposed to tick it accordingly. Ive tried click image, get attributes. But not working. I’m a bit weak at selectors, Can someone give me the solution to work with them.

excel data

Thank you

Hi,

Can you try the following condition?

row(2).ToString = "TRUE"

Secondly, I’m facing issues in Radio buttons. I have 3 radio buttons, and after checking in excel row it is supposed to tick it accordingly. Ive tried click image, get attributes. But not working. I’m a bit weak at selectors, Can someone give me the solution to work with them.

Can you share screenshot of UiExplorer of the radio button, if possible?

Regards,

I already tried row(2).ToString = “TRUE” before, didn’t work.

Hi,

Can you check content of row(2) using WriteLine activity, MessageBox etc?

And perhaps you should use UiExplorer. It shows list of proerties (attributes) of the element and we need to use it in GetAttributer activity.( In general, it will be “checked” property)

Regards,

I checked the content already too. It is coming out to be True. messagebox

Hi,

String comparison is case-sensitive. so you need to write row(2).ToString = "True"
Or
row(2).ToString.ToLower = "true" if you want to handle it as case insensitive.

And you can set attribute name in Get Attribute activity as the following image.
img20210226-4

Regards,

1 Like

I got it correctly with True, Thank you so much. But the excel data says TRUE, then why does it have to be True.

And, sorry I didn’t get the image. Still dont know what to do for radio buttons.

Hi,

In some case, data from excel is automatically converted to internal expression in UiPath, such as DateTime, Boolean etc. If we handle these data type, need to take care its format/expression.

And, sorry I didn’t get the image. Still dont know what to do for radio buttons.

Can you try the following steps?

  1. Put Get Attribute Activty in you workflow
  2. Click “Indicate Screen” and choose radio button which you want to check.
  3. Set “Checked” to Attribute property.
  4. Set boolean variable in Result proerty, to get its result.

Regards,

Hai @Tanu.Sharma

For radio button, use click activity. In selector, select aaname and pass like this in aaname selector "aaname=’ “+row(“Status”).ToString+” ’ ". It will click the radio button based on your status value. Thanks.

1 Like

Ok, Thank you, One last question - So after getting 3 boolean variables as attribute’s result, I need to check if whichever is true, check that radio button? Three separate if conditions?

Thank you for the response. So I have to click activity and this change in selector in all three radio buttons?

Hi,

Three separate if conditions?

Basically yes. However if you want to avoid multiple if activity, switch activity might be used as workaround like the following expression, for example.

Convert.ToInt32(resultA)+Convert.ToInt32(resultB)*2+Convert.ToInt32(resultC)*4

This returns 1,2 or 4 and we can use it as case.

Btw if I misunderstand your requirement and you want to check radio button, can you try to add Title attribute to your selector? Uiexplorer will help to make it.

Regards,

Just use one click activity and change the selector accordingly.

Use the above method in your selector. It will click the radio button based on your value. Thanks.

1 Like

row(1).item(2).tosting="TURE
or you can sue datatbalevar.rows(1).item(2).tostring="TRUE

I’m getting this error. I put 3 if conditions and checked all 3 values and used click radio button.

Thanks I’ll try.

1 Like

use get attribute activity and select uiexplorer to choose target attribute like aaname,tiltle etc

Hi,

Can you check if there is other proper element inside the element to click triangle mark as the following image? If there is, please set it to selector of the activity.

Regards,

@vignesh.ks
I’m still not able to work it out. If I use click activity on New button, and open its uiexplorer, it says not validated. But green sign comes in edit selector. And after passing "aaname=’ “+row(“Status”).ToString+” ’ " in place of aaname, it again becomes red and not validated.

@Yoichi
No there isn’t. And when opening in UIexplorer the red invalidated button goes on.