I’m a beginner in UiPath and I’m having a bit of trouble implementing 3 scenarios.
so it starts like this: on the web page, User puts a reference code e.g 1234APK in the search bar and then clicks search; one of 3 things are expected to happen -
To put this into perspective; The items in the dropdown change dynamically sometimes based on input value, if the ref code above (1234APK) gives cat, dog, rat in the dropdown for example, a different ref code; say 1245LKO may give fish, chicken, rat. Rule of thumb is always to choose ‘rat’. ‘Fish’ is always the secondary option.
Logic is: if ‘rat’ is present in dropdown, (irrespective of ‘fish’ being present or not) then ‘rat’ should always be chosen,
if ‘rat’ isn’t available, choose ‘fish’
else i.e. if ‘rat’ nor ‘fish’ isn’t found in the dynamic dropdown items, terminate process.
Not sure if I was able to convey this clearly but I would appreciate any form of help
Thanks for your feedback. I believe the above solution works for a dropdown that contains everything.
In my case, input A may only contain just rat, dog, chicken in the dropdown, while input B may only contain just cat, pig, fish.
In the example above, they are assuming a single dropdown should contain everything but in my case there can be up to 3 different versions of dropdowns containing distinct items.
Sorry Mukesh but would it be possible to see a visual process of the array of String conditions in uipath? Because now I have 3 types of ListItems, do I name them ListItems1, ListItems2, ListItems3? It would be incredibly helpful to see this visually in uipath. Thank you
For Demo - I am using the below Website in Chrome -
As you see in the screenshot below - I am reading the Friend DropDown
So I am Getting all the Items in a List of String.
Next I am Checking this List of String for the values i want and Based on it I am setting the item Variable… That will be again used to select the item,
Thanks so much Mukesh. I just opened the file now but the 1st and 3rd activities are unable to open on my machine. Compatibility issues I guess… do you mind sending a screenshot? Thanks a million!
Hi Mukesh, thanks for sending the screenshots. Do you mind if I see the properties tab for ‘Get Attributes activity’? I think I may have missed out on some important elements as I’m still having issues. Thanks for your patience
Also, how was the ListString variable derived? And the Output.Trim item in the “Add to Collection” properties section. Pardon my questions but I’m a total beginner at this.
Let me try to explain what is happening in the Flow -
We Attach the Browser and Point it to the page where we have the DropDown
We use Find Children and point it to the Dropdown. This Result is a List of UI Elements called Child… Now Child will have 5 Ui Items Assuming we have 5 element in dropdown
3.Now we have to extract the item information from each of ui element from child - hence we use a foreach loop and loop items in child.
Inside Foreach we have used the get attribute and defined innertext meaning - the name we want is in the attribute innertext - The output is stored in variable called Output.
Now we have created a List of String - This list of string will be holding all the 5 items from the dropdown’.
Hence - Add to Collection is used - Output.Trim is used just to remove the extra spaces that might come.
After the for each loop completes, we would have a list of string consisting of all the items from Dropdown.
Next we validate the List of Strings for our Condition.