I have a Select Item activity and I need it to go to a drop down and click on Update Activity. In some cases the Update Activity is there and in some cases it is not. I need to handle both situations. If it is there then I am good and can continue. When it it not there I need to handle the error. Here is the image. I believe I need to use Try Catch but I’ve never used it before.
What do I put in the Catches section? I have an If activity which I’d like to insert but it doesn’t seem to allow it.
What is the best way? Would another method work better?
check the variable scope of text that it is reachable for the if check. Also gie a try on renaming the variable e.g. to strText
As alternate approach in such cases with find children the DropDown items can be retrieved and evaluated. If it is found, tthen it can be used for clicking or selecting. Have a look here
@ppr - or anyone really. I checked and the variable (I am using UpdateGEMA as the variable) has a scope fitting this section of the workflow. For some reason the If statement isn’t working correctly. I have a Get Full text activity assigned to the above variable and I’m using an If statement as follows:
If
UpdateGEMA.Split.Contains(“Update Activity”)
Then
Else
Go do something else
I can see that in this case there is an “Update Activity” in the drop down but it is not seeing it. What am I doing wrong?
@ppr - Thank you again. Yes, sometimes the option Update Activity is there and sometimes it isn’t. I need to take action for either case. I have no experience with Find Children. It looks like I need to do the following from your link:
Find all selectitems with find children (Selector indicated to DropDown, Filter configured to SelectItems)
How do I do this?
@ppr - Thank you, I’ve got this
In Filter:
In the Selector I have:
but I feel like this isnt something I just type in. How does this data get there?
For the output variable I created Children but I’m getting an error message as follows
@gameplayer13905
the selector could / should rewired (indicate item or done by UiExplorer manually with locating in the visually tree and set as target)
the Children datatype seems to be in the wrong datataype. Just delete the variable from variable panels. Click on Output - Children and recreate the variable with STRG+K
@gameplayer13905
You can initiate the creation of a new variable with pressing the keyboard Key CTRL + K
For Selectors Knowledge the courses are available on the ACADEMY : UiPath Academy