EDIT: Hey y'all - turns out to save space my phone uninstalled Survey123 recently, which is why the link wasn't working. After reinstalling Survey123 these links work no problem. Problem solved 🙃
Hello,
I'm trying to use a arcgis-survey123:// URL to pass some data from a Field Maps feature into a Survey123 form, but the link isn't working on the field app (iOS).
In Map Viewer Classic, I could set up a custom attribute display and use some HTML like the following to create a clickable button that invoked S123 and passed some attributes:
From Survey123 URL Generator
Â
<a href="arcgis-survey123://?itemID=ff70663e06e2456bac578886431ae7dc&field:guid={GlobalID}"><img src="https://dabuttonfactory.com/button.png?t=Add+Data+to+Subplot&f=Roboto-Bold&ts=24&tc=fff&tshs=1&tshc=000&hp=20&vp=8&c=5&bgt=gradient&bgc=6aa84f&ebgc=274e13&shs=1&shc=444&sho=s" alt="Add Data to Subplot"></a>Â
Â
The above method has worked with Map Viewer Classic for a few years. This year we designed a new field map using the new map viewer, but the old expression isn't working anymore.
I've tried building the pop-up expression a few ways:
- I've tried embedding the above HTML button in a pop-up text element
- I've tried constructing the S123 URL in an Arcade expression, then invoking the returned text as an HTML text element in the pop-up
- I've tried placing the survey123 url as plaintext in the pop-up, but it's not clickable
- I've tried hyperlinking the S123 URL to plaintext, but it has the same strange non-clickable behavior as the button
- I've tried using both URL formats https://survey123.arcgis.app and arcgis-survey123://?
The strange behavior (see attached video): When I interact with the button or link, it seems like it's being treated as an image. Short pressing the button tries to highlight the button text. Long pressing the edges of the button "grabs" it as if it were an image, but also shows a preview to a correct-looking arcgis-survey123:// link. Previously I could just tap this button and Survey123 would open to the linked survey on my device.
Other hyperlinks seem to work fine (e.g, 'www.google.com', or just 'google' hyperlinked to that address) - one tap opens the link in my mobile browser as expected.
Arcade expression:
Â
Â
Â
// Define the itemID and field parameter
var itemID = "ff70663e06e2456bac578886431ae7dc";
var guidField = $feature.GlobalID;
// Construct the URL
var s123URL = "arcgis-survey123://" + "?itemID=" + itemID + "&field:guid=" + guidField;
// Return the constructed URL
return s123URL;
Â
Â
Â
Â
Returns this URL:Â
text:Â "arcgis-survey123://?itemID=ff70663e06e2456bac578886431ae7dc&field:guid=2950fa9a-c9da-4ba3-aeb7-6823244c91d7"
Which I try to invoke in this expression in a text element in the pop-up:
Â
Â
Â
<p>
<a href="{expression/expr2}" target="_blank"><img src="https://dabuttonfactory.com/button.png?t=Add+Data+to+Subplot&f=Roboto-Bold&ts=24&tc=fff&tshs=1&tshc=000&hp=20&vp=8&c=5&bgt=gradient&bgc=6aa84f&ebgc=274e13&shs=1&shc=444&sho=s" alt="Add Data to Subplot"></a>
</p>Â
Â
Â
Â
Thanks for any help!