Reputation: 13
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.sstatic.net/GZLP3.png
Options for gender dropdown: https://i.sstatic.net/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.
Upvotes: 0
Views: 481
Reputation: 5299
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}}*
Upvotes: 0