I have a survey that I created in Connect, published to Enterprise. Everything seems to work just fine with survey. My problem is arising when trying to link to a survey record in the Survey123 manager. In the web map where survey results are managed, I am creating a link so that the user can link directly to the Survey123 manager to export reports.
Here is my Arcade expression:
var eventformID = '160110589ab542ef92079dedb043c503'
var eventFormURL = "https://survey123.arcgis.com/surveys/" + eventformID;
var eventObjectID = $feature.OBJECTID;
return eventFormURL + "/data?objectIds=" + eventObjectID
Then the Returned URL is used as a hyperlink to the record.
Here's the weird thing: If I've logged in to the Survey123 manager in my Enterprise Portal before I click any of these links, I get there fine. But if I have not (not cached in the browser, I'm guessing), then when I click on the link I am prompted for AGOL login credentials:
But the form is published to Enterprise so...does anyone have any ideas for how to get around having to login manually? I hope that the link would go directly to Enterprise login prompt instead of AGOL.
Solved! Go to Solution.
Oh, whoops! S123 is very sensitive to capitalization in URL params. It's portalUrl with a lower-case P. Try that?
Also, what's the data parameter do? I've never used it.
The URL needs the parameter &PortalUrl=<yourURL> added to it so that S123 knows explicitly to look in your org for the form.
Thanks for such a fast response! I based my Arcade expression and URL specifically to hit something like this, which is what I see in the manager:
https://survey123.arcgis.com/surveys/160110589ab542ef92079dedb043c503/data?objectIds=3204
So I added the Portal url:
https://survey123.arcgis.com/surveys/160110589ab542ef92079dedb043c503/data?objectIds=3204&PortalUrl=<myURL>
And I get an error saying I need an AGOL organization:
ETA: The warning appears after I'm prompted for sign in via Enterprise, so that's something!
Oh, whoops! S123 is very sensitive to capitalization in URL params. It's portalUrl with a lower-case P. Try that?
Also, what's the data parameter do? I've never used it.
That seemed to do the trick! The data parameter seems to select the record in the data table, so that my user (not super tech/GIS savvy) can go from web app to S123 manager and easily export a report based on my pre-loaded template.
Ooo, I've definitely got a future use case for that!