Problem with get attribute "visibility"

Hi, I am trying to use a Get attribute activity to evaluate an error icon on my UI (the error indicates a blank field).

My activity works as follows

  • Get attribute “visibility” (error icon)
  • Save to output “Norecord”
  • If Norecord is True (ie the error icon exists)
  • Write Message box “Missing data item - please submit manually”

When I try to use Norecord in an IF statement with syntax like:
Norecord.Equals(0)

I obtain an error “String converter cannot convert from System.Int32”

When I use UI explorer there are very few attributes I could use with this icon (beyond visibility).

Can you help me with my syntax?

HI @andrew.haworth

you need to add “0” like

Norecord.Equals("0")

and also check what the norecord variable is returning while running the process and then pass that value in the condition like

Not Norecord.Equals("Error Case or something that the norecord variable returns")

Regards
Sudharsan

HI @andrew.haworth

You can also try with Contains

Norecord.Contains("0")

image

Regards
Gokul

@andrew.haworth

Please confirm the value that you are receiving from the particular attribute. You can print in a message or run in debug mode and verify once.

After that you can write the condition

Norecord.Equals(“0”)

But make sure Norecord variable is returning “0” to meet the condition.

Thanks

Thanks for the quick reply.

I followed your advice and tried to write the visible attribute output to a message box. Regrettably, the activity fails with a System.Int32 error before my message box appears.

I have tested using the activity in isolation. This is working as expected Typically, the activity will run inside a use application/web browser, then for every row in my data table.

Each time I test the activity in this context it fails with error:

image

Can you help?

A

Hi @andrew.haworth ,

Could you change the variable type from String to UiPath.Core.GenericValue and check whether it is able to work ?

If it works, In later Comparisons, you would need to add .ToString to it for comparison :

NoRecord.ToString.Equals("0")

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.