I am working with a feature layer, a related table, and a survey built from S123 Connect that, when submitted, adds a record to the related table. The feature layer is a point layer with a variety of information, while the table is related "one-to-many" to the "Name" field in both the feature and the table. The "Name" field is my feature's unique ID.
The purpose of this workflow is to allow field personnel to navigate to a point using field maps, and then click the point which will present the user with a custom pop up that has a link to survey123 mobile, with certain survey questions auto-populated based on the information of the selected point. I used the guidance in this article to set up this workflow:
I configured my feature pop-up to use the following link to direct the user to survey 123 mobile.
The Pop-Up is as follows:
But.... When I click "HERE" to link to the survey, the Survey looks as follows.
You can see how the Tract name after "Posey" is cut off and then no additional auto-populated information is available in the survey (Missing Point ID and GAP Habitat Majority-autofilled questions). However, it was only 2 points exhibiting this type behavior. All other habitat point surveys that were opened would show the auto-populated information: the tract name, point ID and GAP Habitat Majority when opened in S123.
I deliberated on this issue until I tried removing the apostrophe from the tract name. Consequently, the survey/field map work flow worked as it should, at the compromise that the tract name is no longer reflected correctly in the pop-up or in the related records. My big question- Is there a work around for this issue? Has anyone else ran into this? Clearly apostrophe's don't have a place in this work flow so is there any way this is a bug? I'd like to reiterate the point that the rest of the workflow works with no issues, for the exception of the two points that occur specifically on this Forever Wild Tract.
When I change the tract name of the feature to "Poseys" instead of "Posey's", the form is autopopulated with no issues. Note: Habitat majority is different in this screenshot but it is still a point that occurs on the same tract with the tract name in question.
I hope this makes any sense and will be happy to answer any questions anyone might have.
It is recommended to encode URL parameters. Encoding replaces invalid characters with the percent sign followed by their hex equivalent. Please see , https://doc.arcgis.com/en/survey123/reference/integratewithotherapps.htm#ESRI_SECTION1_7E0A66ACA8504... for more information
Good morning Zach,
Thanks for your reply.
I changed my link to now :
I got the pass through to work once I included encoded values in my feature layer as you can see in this picture.
While now the survey opens with no issues and looks as it should, I'm running into an issue where my pop up reflects the encoded value of the layer.
When I click the link to open survey, everything appears fine.
My big question now is, how can I code my pop-up to replace that hex code with the actual apostrophe? I'd like to avoid going as far as creating a whole new tract_name field as an alias field for my pop-up. Is there a work around to avoid doing this?
Hi @Rice_GIS ,
You can keep the apostrophes in the actual attribute values and use an Arcade expression to encode the values from that field to replace " ' " with "%27" to include the encoded values in the URL instead of the actual values that contain apostrophes.
Updated URLs (attribute values encoded using an expression):
If you have multiple fields containing values with apostrophes that you need to pass as URL parameters to Survey123, you need to add a expression for each field.
If you are using the custom URL scheme only to launch Survey123 from Map Viewer, you cannot use this workflow since it will not give you the expected results. Map Viewer automatically encodes URLs so it replaces % in %27 (from the Arcade expression results) with "%25". As a result, it does not pass the expected values to the questions (e.g. "Amelia%27s French Bakery").
This workflow must be used only if the custom URL scheme is being utilized in mobile apps like Field Maps where the app reads the encoded values and passed the correct values to the survey form as expected (e.g. "Amelia's French Bakery").
Hi @JeremyMiller ,
One way to do this is to use an Arcade expression to encode the attributes that you want to pass as parameter in your custom URL and use it in your pop up. Below is an example:
1. From the pop up section, open Attribute expressions
2. Add an expression to replace any characters in your attributes that need to be encoded. For example, use an expression like below to replace ' with %27:
5. Replace the field name with your expression id in the hyperlink to open your survey form and pass the encoded attributes. In the example below both URLs are included for comparison. First URL uses the actual values from the field and second URL uses the encoded values.