Hello, My team created a Survey123 form for damage assessment and are displaying the submitted survey forms as embedded content in a Dashboard if someone clicks on the survey point. The problem we are having is the form is so large that when using "?mode=view" to embed it, only a portion of the survey will load but when using "?mode=edit" the entire survey will load. We don't want everyone who sees the Dashboard to be able to edit the survey but we do need a subset of people (Non-GIS Users) to have permissions to submit edits.
?mode=view:
Cuts off at the same spot on every survey
?mode=edit:
Loads the entire survey without problem
We need members of the organization to be able to View and Submit surveys but not edit and then we need certain members to have View, Submit, and Edit permissions. Or we need a way embed the survey in "?mode=view" so it loads the complete form. This will be used in our Emergency Operations Center so loading and preserving this data is critical.
Thanks for any suggestions!
If it cuts off at the same spot consistently, what question is there? Is there any formatting that's different?
The question is a group that only gets displayed after a park that contains the items is selected above. But this format is used for the entire survey. For instance, we need to ask questions about damage related to Soccer fields but if the park doesn't have soccer fields those questions don't get displayed. In the example in my post, the question shouldn't even be shown since its not relevant to that park.
This selection determines what questions get displayed:
Is this form usually completed on the web on on the mobile app? I wonder if something in the syntax for the visible or not isn't meshing with the web form experience since it's showing things it shouldn't and cutting off at the end. Have you tried viewing it in the web browser outside of the dashboard embed?
As jcarlson said below, you could always create a secondary form for the Dashboard as well, I have done that in a few cases to show separate fields for supervisor approvals, but they weren't very long forms so I don't know if there's some sort of cut off in the dashboard (there shouldn't be?)
There are a couple ways you could do this. The simplest is to make the embedded form view-only, but add an "edit entry" link / button to the dashboard that opens an editing form in another tab / window. Properly shared, only authorized users will be able to see that form.
A more advanced way is to use a Data Expression. You can actually use the function GetUser in your expression to alter the output of the expression based on the user's group membership. In this way, a typical user would literally see a different embed URL with ?mode=view tacked on, whereas your editors would see it with ?mode=edit.
It might look something like this:
var user = GetUser()
// see if user in designated group, set URL param accordingly
var mode_param = Iif(
Includes(user['groups'], 'editors group'),
'edit',
'view'
)
// get layer
var fs = FeatureSetByPortalItem(
Portal('your portal url'),
'itemid of service',
0, // layer index
['globalid'],
false
)
// build FeatureSet with survey URL fields
return Distinct(
fs,
[
{name: 'globalid', expression: 'globalid'},
{name: 'survey_url', expression: "'https://survey123.arcgis.com/share/surveyitemid'"},
{name: 'mode_param', expression: `'${mode_param}'`}
]
)
Then for your embed URL, you can string together {survey_url}?mode={mode_param}&globalId={globalid}.
You might consider making a totally separate survey for your viewers, too. You could define the survey URL based on the user information, not just the mode param, and load different surveys based on who is logged in.