KeyofSea123
12 years agoContributor
[Resolved] Iteration of a map using a list
I know how to build the map and the list but I can't seem to figure out how to retrieve the values that match the key names in the list.
I've tried so many things that I'm not sure what code to send to you. For each row of my data driven POST request, I could have as few as 1 pair in the map or as many as 21. I build my map and list for each data row. I'm trying to return the map value that matches the key from the list.
These are examples of my map and list:
map: ['requestRegion':'WA', 'requestCity':'SEATTLE', 'requestPostal_code':'98101', 'requestContact_phone_number':'2538159999', 'requestEmail':'Email20130412085140%40wvus.org', 'requestContact_phone_country_code':'1', 'requestDirect_mail_restriction':'DO_NOT', 'requestFirst_name':'First2013_04_12T08_51_40_546', 'requestPhone_restriction':'DO_NOT', 'requestAddress1':'085140546Lane20130412', 'requestCounty':'KING', 'requestLast_name':'Last2013_04_12T08_51_40_546', 'requestEmail_restriction':'DO_NOT', 'requestCountry_code':'US', 'requestParty_name':'First2013_04_12T08_51_40_546Last2013_04_12T08_51_40_546']
fieldNames: ['requestRegion', 'requestCity', 'requestPostal_code', 'requestContact_phone_number', 'requestEmail', 'requestContact_phone_country_code', 'requestDirect_mail_restriction', 'requestFirst_name', 'requestPhone_restriction', 'requestAddress1', 'requestCounty', 'requestLast_name', 'requestEmail_restriction', 'requestCountry_code', 'requestParty_name']
If I have the wrong approach please tell me the best way to do this.
Also, there is %40 instead of @ in the email address. I've tried c.replaceAll("%40", "@") and it doesn't work. What should I be using?
Thanks in advance for your help.
Trish
I've tried so many things that I'm not sure what code to send to you. For each row of my data driven POST request, I could have as few as 1 pair in the map or as many as 21. I build my map and list for each data row. I'm trying to return the map value that matches the key from the list.
These are examples of my map and list:
map: ['requestRegion':'WA', 'requestCity':'SEATTLE', 'requestPostal_code':'98101', 'requestContact_phone_number':'2538159999', 'requestEmail':'Email20130412085140%40wvus.org', 'requestContact_phone_country_code':'1', 'requestDirect_mail_restriction':'DO_NOT', 'requestFirst_name':'First2013_04_12T08_51_40_546', 'requestPhone_restriction':'DO_NOT', 'requestAddress1':'085140546Lane20130412', 'requestCounty':'KING', 'requestLast_name':'Last2013_04_12T08_51_40_546', 'requestEmail_restriction':'DO_NOT', 'requestCountry_code':'US', 'requestParty_name':'First2013_04_12T08_51_40_546Last2013_04_12T08_51_40_546']
fieldNames: ['requestRegion', 'requestCity', 'requestPostal_code', 'requestContact_phone_number', 'requestEmail', 'requestContact_phone_country_code', 'requestDirect_mail_restriction', 'requestFirst_name', 'requestPhone_restriction', 'requestAddress1', 'requestCounty', 'requestLast_name', 'requestEmail_restriction', 'requestCountry_code', 'requestParty_name']
If I have the wrong approach please tell me the best way to do this.
Also, there is %40 instead of @ in the email address. I've tried c.replaceAll("%40", "@") and it doesn't work. What should I be using?
Thanks in advance for your help.
Trish