Hi All
I have constructed an Arcade expression to parse field values in from a selected feature (in Field Maps) to a url and open up and fill in an online form:
var url = "https://xxxx.gov.au/xxxx/xxxxx/SmartForm.html?formCode=MRF"+"&"+$feature["doc_no"]+"&"+$feature["f1_lichold"]+"&"+$feature.reader+"&DEWNR staff"+"&Annual"
return url
It work fione except for when a name in "f1_lichold" has an & in their name eg D & S Smith. The form just fills in D as the name and fails to complete the rest of the values.
I am assuming that "&" is considered as a break, but is there anyway I can construct the url above to avoid this and fill in the name as D & S Smith?
Note I have also tried just creating a link in the pop up as so
https://xxx.xxx.gov.au/xxxx/xxx/SmartForm.html?formCode=MRF&{doc_no}&{f1_lichold}&{reader}&DEWNR staff&Annual
But the result is the same
Cheers
Chris
Solved! Go to Solution.
I believe you need to encode text values when the characters are invalid for URLs
https://developers.arcgis.com/arcade/function-reference/text_functions/#urlencode
See comment for spaces and text values
I believe you need to encode text values when the characters are invalid for URLs
https://developers.arcgis.com/arcade/function-reference/text_functions/#urlencode
See comment for spaces and text values
Thanks for the tip
Adding UrlEncode prior to the offending field worked
"https://xxxxx.gov.au/xxxxxx/xxxx/SmartForm.html?formCode=MRF"+"&"+$feature["doc_no"]+"&"+UrlEncode($feature["f1_lichold"])+"&"+$feature.reader+"&DEWNR staff"+"&Annual"