iMacros website form dropdown menu

481 views Asked by At

I'm trying to automate filling a form that reads data from a csv file and inputs the data into the website form in the screenshot below. However, I can't seem to figure out how to get the gender dropdown selection to work correctly.

Screenshot of website: https://i.stack.imgur.com/GZLP3.png

Options for gender dropdown: https://i.stack.imgur.com/ZWr79.png

I am using: TAG POS=1 TYPE=SELECT FORM=NAME:new_patient ATTR=NAME:gender CONTENT=${{!COL5}}

Where my csv file has the letter "F" (for female) in Column 5. I have tried using % as well. I am currently using the iMacros 10 browser but will ultimately use Chrome as my browser of choice if possible for this.

1

There are 1 answers

2
Shugar On

I believe this code will work:

SET option EVAL("switch ('{{!COL5}}') {case 'M': s = 'Male'; break; case 'F': s = 'Female'; break; case 'U': s = 'Undifferentiated'; break; default: '';}")
TAG POS=1 TYPE=SELECT FORM=NAME:new_patient ATTR=NAME:gender CONTENT=${{option}}

...or just so:

TAG POS=1 TYPE=SELECT FORM=NAME:new_patient ATTR=NAME:gender CONTENT=${{!COL5}}*