Hi all,
I have a survey that includes several pulldata expression to pull the location's APN number and other data from a parcel feature service and a few other layers. The survey worked fine for a long time until our parcel data provider changed their data delivery model. Formerly, the layer was shared with us through group sharing. Now, we have a new feature service URL and credentials for accessing it. I have added the layer as an item in our ArcGIS Online organization with embedded credentials, and it works fine everywhere except in this survey. Now, the pulldata expressions return nothing, even though I have updated the URL (the pulldata expressions pulling data from other layers still work).
pulldata("@layer", "getValueAt", "attributes.apn", "https://utility.arcgis.com/usrsvcs/servers/[ITEM ID]/rest/services/Gateway/statewide_o/FeatureServer/0", ${location})
Does anyone know how to handle this? @JamesTedrick, can you point me to a resource that would help me?
Thanks!
Solved! Go to Solution.
UPDATE: using the developer tools in a web browser to look at network traffic when I click on my parcel layer in another internal app, I was able to see how the URL was formatted there. It included a token URL parameter, so I copied that token URL parameter and tacked it onto the end of the layer URL in my pulldata request, and that worked.
Format:
pulldata("@layer", "getValueAt", "attributes.apn", "https://utility.arcgis.com/usrsvcs/servers/<insert item ID>/rest/services/Gateway/statewide_o/FeatureServer/0?token=<insert token here (it's a very long string of characters)>", ${location})
Updated to add: Note that the field names are case sensitive!
Hi @HollyTorpey_LSA, sorry about that!
I think there are two parts to this. First, the pulldata("@layer") doesn’t use your item’s embedded credentials unless you reference the item, not the raw service URL. If you haven't done that yet, I would recommend adding the layer as "Linked content."I believe it is in the Connect Settings.
Also, and this is not guaranteed, I'm just speculating because this is how a web app accesses a stored credential feature layer, try adding after FeatureServer/0?portalUrl=https://www.arcgis.com&itemID=<YOUR_ITEM_ID>"
Do you face the same issue using the survey with the browser and the Survey123 field app?
Wishing you all the best!
Thank you for the response! I'll try your suggestions and let you know how it goes.
@Leena_Abdulqader Sorry for the slow response.
I'm trying to add the layer as linked content, but it appears that I can only add the following content types:
I tried adding the URL parameters (and a bunch of variations thereof) but no luck so far. I've also tried adding our organization to the domain (https://utility.<org>.arcgis.com). The pulldata expression returns nothing in both the mobile app and the form opened in a browser.
If you know how to add a layer as linked content, please let me know!
Thanks,
Holly
UPDATE: using the developer tools in a web browser to look at network traffic when I click on my parcel layer in another internal app, I was able to see how the URL was formatted there. It included a token URL parameter, so I copied that token URL parameter and tacked it onto the end of the layer URL in my pulldata request, and that worked.
Format:
pulldata("@layer", "getValueAt", "attributes.apn", "https://utility.arcgis.com/usrsvcs/servers/<insert item ID>/rest/services/Gateway/statewide_o/FeatureServer/0?token=<insert token here (it's a very long string of characters)>", ${location})
Updated to add: Note that the field names are case sensitive!