I have an excel in which i have a column “Gender” in which i have values such as Male, Female, Unspecified etc.
Based on the value provided in Excel column “Gender”, RPA must open the “Gender” drop down in my web application and press “F” if excel value is Female and “M” if excel value in Male and likewise.
How do i get this done Dynamically?
There are two approaches we can handle this situation with.
We have a activity named select item activity, that can select the item that we want from the drop down list.
Else if you are not ale to use select item activity for that element, kindly consider the following sequence,
–get the value from the excel and assign it to a variable (Gender)
–use an if condition like if Gender.tostring.equals(“Male”) under then container, use click activity to click the menu and again click activity to click “M” or in else container, do the same to click “F”
For approach 2, i have 5 values in the gender drop down. How do i get each of them selected based on my value in Excel using IF
What i tried is “type into” and then followed by SendHotKey.
how do i store all 5 and then call each one based on the value in excel?
I Cant type into the field. However, i can click on the drop down and then i user “Send hotkey” as “F” to select female.
having said that, its static. I would like it to be more dynamic where if my excel column says “Male”, then it should select “male” from the drop-down, and if it says “Female”, then select female, if it says Unspecified, then select option Unspecified and so on.
Attached is the image of the drop down.
Buddy…! you can click dynamically on a drop down list by using Click image activity next to a click activty (for clicking the down arrow), have if condition or switchcase condition to click on the text (image captured with click image) to access it dynamically.
Hope this would help you…Kindly revert for any suggestions
After that, i have used “If” Condition where
IF row(3).ToString = “Female” then “Type Into” as “f” and Send hotkey “enter” ELSE
if row(3).ToString = “Male”, then “Type Into” as “m” and Send hotkey “enter”
However, as i mentioned earlier, there are 5 values in a drop down and if i keep doing if else, it becomes too big. I want to know if i can dynamically provide all values in one and based on the value in Excel, it can click on female or male or unknown or unspecified etc.
Note: I have several other drop downs with many many options across the whole application. So if we can figure out a certain way to do it easily, then i can apply the same logic across all other drop downs.
Great…! Lets take it this way…whether you have a column with 5 rows having only distinct gender values or 50 rows each row with different gender…i hope you are going to get those values of the specific cell using for each row or for each loop…using assign activity like GenderValue = row(gendercolumnname).tostring, inside a loop…
Here comes what to do next…
Once you get the variable…use sub string to get the first character of the gender value and assign it to a variable…
Now use click activity with the value of substring variable and send hotkey
This would enter dynamically based on the the value in the Excel…
Hope this would help u
it is possible using click activity if select item activity not supports,using click activity indicate on of the drop down value like Male you ll get a selector ,their you ll get a aaname=‘Male’ if not get like use ui explorer and get the full selector with aaname and their you pass aaname=’"+yourvariable+"’
if it not works use type into activity to type the value in drop down if it supports for type into
But problem with this is only you can select visible values from the dropdown list. If suppose dropdown has more values and you want to select downside values from the dropdown then selector won’t identify the elements.
Type Into Activity (row.Item(“Gender”).ToString +"[k(enter)]")
For activity 2, in my excel i have given only first 3 starting characters of the option that i want to select. So the bot is pressing those 3 characters and arriving at the option that i have given in excel.
However, this is not the solution that i am looking for.
Issue here i think is that the drop downs that i have are “Angular” drop down or P-Dropdown. That may be the reason why i am not able to use “Select Item” activity