Hi-
I'm wondering if it's possible to click on a map either from Field Maps or a map in Survey123 that would then prepopulate certain questions? I have done some research and tried this: pulldata("@layer", "getValueAt", "attributes.NEW_MH_ID", "https://services7.arcgis.com/nZUcF2JydS8L5n3y/arcgis/rest/services/FSDMH/FeatureServer/2",${location}) but it's not functioning for me the way I would like. And not sure if this can only be used for polygon layers as the layer I'm wanting is a point layer. I had also tried creating a url that goes into the pop-up so when they click on the manhole it then should take them to survey123, but when I test it out it doesn't open the survey. If someone could tell me what i might be doing wrong that would be great!
Here is the code for the popup url which was generated through GitHub: <a href="arcgis-survey123://?itemID=0f782ed1a0de433b97092951c1038447&field:manhole_id={NEW_MH_ID}&field:manhole_depth={Z}"><img src="https://dabuttonfactory.com/button.png?t=MH+Survey&f=Roboto-Bold&ts=24&tc=fff&tshs=1..." alt="MH Survey"></a>
No none of the fields have arcade expressions and I have a field in the attributes table that lists the Z values the field name is Z. What i meant in regards to that sentence was that within the pop up for the MH layer the url calls out those attributes i'm trying to obtain. not sure you can see this screen shot well but i can't extend the pop out anymore than it already is.
But if the formatting looks correct and i know those fields are a text and integer field and those aren't being sent through a repeat.... so I'll keep digging. otherwise I'll just default to a .csv file i guess.
I appreciate your help and insight!
Here's the info you need on integrating using a web form. There are some very distinct differences in formatting a link to open a web form vs launching the app, specifically where/how you insert the item id for the form. Launch the web app—ArcGIS Survey123 | Documentation
<a href="arcgis-survey123://?itemID=0f782ed1a0de433b97092951c1038447&field:manhole_id={NEW_MH_ID}&field:manhole_depth={Z}"><img src="https://dabuttonfactory.com/button.png?t=MH+Survey&f=Roboto-Bold&ts=24&tc=fff&tshs=1..." alt="MH Survey"></a>
Is this the extent of building the link for the arcade pop-up? If so, it won't work in my experience. I've found that I need to call variables outside of the link text, encode it, and then concatenate the full html for the link.
Starting simple and leaving out the image button for now, what I would do to launch the web form from a pop-up is put in some arcade that looks like this:
var sourceURL = 'https://survey123.arcgis.com/share/';
var itemID = '0f782ed1a0de433b97092951c1038447';
var qmark = "?";
var manholeID = $feature["NEW_MH_ID"];
var manholeDepth = $feature["Z"];
//To launch a web form the link format is https://survey123.arcgis.com/share/<itemID>
//To launch the app instead your item id is passed in as a parameter https://survey123.arcgis.app?itemID=<itemID>
var linkTXT = Text("MH Survey");
var params = {
//Add all your url parameters to format the link in here so they get properly encoded
//set open to web for web form
open: 'web',
//calling a field to pass on has to be done as
//"field:<outputfieldname>": $feature["inputfieldname"]
//otherwise there is an issue where one of the : won't get encoded properly and it won't work
"field:manhole_id": manholeID,
"field:manhole_depth": manholeDepth
};
var fullURL = Concatenate([sourceURL, itemID, qmark, UrlEncode(params)]);
var not_zelda = `<div style="text-align:center;">
<a href="${fullURL}" target="_blank">${linkTXT}</a></div>`
//creates the full dynamic urlreturn{
type: 'text',
text: not_zelda,
//This property supports html tags
};
This all looks good to me. Could be some other thing in your form. Any green error marks on any fields?