Select to view content in your preferred language

Data with Symbols not transferring from Survey123 to Field Maps

394
3
01-04-2023 08:35 AM
JordanHolt
Occasional Contributor

I have a database being utilized in Field Maps as a base / master layer. I am using Survey123 to create a maintenance history by referencing the master layer from Field Maps. The referencing ID is the "Serial Number".  In some instances we have Serial Numbers with symbols leading the ID. When the symbol occurs there is no data transferred into the Survey123 maintenance dataset, also any field following are blank. Is there a work around for this or a solution? The symbols are necessary and right now we are just going back and backfilling the data.

3 Replies
ChristopherCounsell
MVP Regular Contributor

It sounds like you are using a custom URL scheme to launch Survey123 from ArcGIS Field Maps pop-up. A field in your URL has values with special characters, which is then truncating the URL.

You likely need to add an expression to the layer in the Web Map to URL encode the field, and then replace the field with the expression in your custom URL. The common example is when values contain spaces.

https://community.esri.com/t5/arcgis-survey123-blog/understanding-survey123-s-custom-url-scheme/ba-p...

https://developers.arcgis.com/arcade/function-reference/text_functions/#urlencode

 

0 Kudos
JordanHolt
Occasional Contributor

Yes, I am using a custom URL scheme to launch Survey123 from Field Maps pop-up. The Serial Number field has a " ' " in it, this is the symbol that is causing the issue. I have added the URL encode expression to the layer in the web map but the symbol is still truncating the URL. Below is the expression I used.

 

var urlsource ='arcgis-survey123://?';
var params = {
  itemID:'408b966252ca4922a01202b63069633f',
};
return urlsource  + UrlEncode(params);
//arcgis-survey123://?itemID=408b966252ca4922a01202b63069633f
 
Can you please let me know what I am missing?
 
Thank you for your help!
0 Kudos
ChristopherCounsell
MVP Regular Contributor

You are missing the serial number field in the expression. Your expression would only return the itemID.

As it's only one field you're interested in encoding, you could make it simpler by just encoding that field in the expression and replacing the field value with the expression value.
 
UrlEncode($feature["assetid"])
 
Then in your custom URL, add the expression as the target field value i.e from
arcgis-survey123://?itemID=89bc8c7844e548e09baa3aad4695e78b&field:AssetID={assetid}
 
to:
 
arcgis-survey123://?itemID=89bc8c7844e548e09baa3aad4695e78b&field:AssetID={expression/expr0}
 
0 Kudos