Select to view content in your preferred language

Passing the feature class URL/REST URL to Survey123

346
2
06-16-2023 08:30 AM
AnthonyFranc
New Contributor

Hi there, 

I am trying just starting to familiarize myself with passing URL parameters in survey123. I found this link very helpful https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-web-form-url/ba-p/...

My goal is to prepopulate a field in my survey123 form with the itemID url or the REST URL. I know its possible to do by hardcoding it in i.e. ?field:FeatureURL=path/to/url/from/search/bar. I was hoping to pass a parameter that has the feature class URL/REST URL information.  I was hoping to automate this process but passing a parameter instead of having to hard code each one.

It seems like these are the only list of parameters that can be passed via URL. 

Just wondering if anything like this is possible. Any help would be appreciated. 

 

Tags (2)
0 Kudos
2 Replies
AnthonyFranc
New Contributor

I tried to pass the "itemID" parameter but it just takes the text and not the actual URL. I hoping it can take the URL.SURVEY123_examples.PNG

0 Kudos
ChristopherCounsell
MVP Regular Contributor

I think this is more an Arcade question than a Survey123 one. You've got the custom URL and Survey123 parameters sorted.

So what you are looking to achieve is identify the itemid of a layer, dynamically, via its pop-up.

This is possible with Arcade e.g.

https://developers.arcgis.com/arcade/function-reference/featureset_functions/#getfeaturesetinfo

// $layer originates from a feature service layer in a web mapGetFeatureSetInfo($layer);
// returns the following:{  "layerId": 7,  "layerName": "My Table",  "itemId": "dda795cf2af44d2bb7af2827963b76e8",  "serviceLayerUrl": "https://utilitynetwork.esri.com/server/rest/services/ClassicNapervilleElectric_Postgres/FeatureServer/100",  "webMapLayerId": 1,  "webMapLayerTitle": "MyTable1",  "className": null,  "objectClassId": null}
You should be able to call on the $layer function from within the Arcade Expression builder, to help compose this. Haven't tested but it may just be $layer.itemid.
0 Kudos