Select to view content in your preferred language

Opening mobile surveys from pop-ups causing unpacking loop

568
12
03-25-2024 08:14 AM
leahmaps
Occasional Contributor II

Hi Everyone,

I have been having this issue for a few weeks now while I have been testing a new survey, and I am not sure what to do to fix it.

In my pop-up, I have two links. One opens the survey in the browser, the other on mobile (as this survey is so big, opening it in an iPad browser doesn't work well). Whenever I try to click the link that would open the survey in the (iPad) Survey123 app, it causes a loop between downloading and unpacking the survey. 

Does anyone have a solution to this? I found a similar posting here, but this survey is private to the organization, and this post is from a few years ago. Nothing seems to solve the problem..

I attached a video, caution watching if you are sensitive to flashing.

0 Kudos
12 Replies
ChristopherCounsell
MVP Regular Contributor

You can't specify the globalid for editing, it's not how the inbox works. Field parameters aren't supported in the inbox. Globalid isn't supported as a field to pass through at all.

You need to apply a query parameter like:

q:globalId=1d392670-33e2-456d-8435-7fad3abd8bb9

e.g. 
https://survey123.arcgis.app/?itemID=exxxccxxxe344548897736ff73029495&mode=edit&q:globalId=de63aef4-...

You should also URL encode the request.

Try using this instead, then adding the expression as a link value in the text editor.

// Set app to open
var urlsource = 'arcgis-survey123://?';

// Set parameters
var params = {
  // item id of survey form
  itemID: '<item_id>',
  // parameters to pass (note no field values work in edit/inbox mode)
  // edit = inbox
  action: 'edit',
  // inbox query, will only return one record if it exists
  'q:globalId': $feature.GlobalID,
  // inbox folder
  folder: 'inbox',
  // refresh inbox
  update: 'true',
  // optional call back to ArcGIS Field Maps
  callback:'https://fieldmaps.arcgis.app'
};
// Combine the app + parameters
return urlsource + UrlEncode(params);

 

0 Kudos
leahmaps
Occasional Contributor II

Hi Christopher,

The URL parameter the other way did work. When you clicked the link in field maps, the inbox had a search for {globalID} = 'whatever the global id was'. Yours did work better as it just did open the survey directly.

However, in my rendition of the expression, the itemID would switch based on the status of the feature class. If it is active, it opened one survey, if it is closeout, it opened another. Is that something that can still be done using this expression?

0 Kudos
ChristopherCounsell
MVP Regular Contributor
Yes, add your var if statememt before the survey parameters then put the
itemid variable in instead of a hard coded itemid string
0 Kudos