q:queryparameter URL parameter for Survey123 Windows and iOS

4285
16
Jump to solution
12-02-2020 04:23 AM
JamieLambert
Occasional Contributor III

Hi All,

Does anyone have a working example of using the q:queryparameter URL parameter to launch Survey123 (Windows or iOS/Android) [edit] from a pop-up and open an existing survey for editing? So far my attempts get me as far as the Inbox, but I cannot load the form with a specific record to edit. I’m assuming that this parameter can be used this way!

The q:queryparameter "Queries the feature layer for an existing record. It can be used to retrieve content that is not on the device." So I should be able to have nothing preloaded in the Inbox.

The example in Integrate with other apps  is q:objectIds=12. I assume this could be q:objectId={objectID} (not sure if 'objectIds' is a typo in the web page?) or even better q:globalID={globalID}.

This is what I have so far and it doesn't work. I have tried a few variations around these with no success (I did also try ObjectID).

I had no issue with creating the URL to open a specific survey in edit mode in the web. The app version is just not working for me. If anyone could provide a working example or point out what I am doing wrong I would very much appreciate it.

Thanks, Jamie.

 

2 Solutions

Accepted Solutions
Skyler
by
New Contributor III

Thanks for the reply,  @JamesTedrick. I was aware of that documentation page; the reason I asked for a working example is that I was running into the same issue as the original poster:

So far my attempts get me as far as the Inbox, but I cannot load the form with a specific record to edit.

After further testing, I've found that when I open a link on my Android device it will take me directly to the correct record to edit as long as I include update=true in the URL, as in

https://survey123.arcgis.app?itemID=<item ID>&action=edit&q:where=ws_stationnumber=5171&update=true

However, this link does not work for me on Windows, in that it will not directly open the correct record for editing (switching the link to use the arcgis-survey123:// URL scheme also doesn't work). I have still not found any way to create a q:queryparameter link that works on Windows. I think the problem may be that update=true is not having any effect on Windows, which may be a separate bug.

It would be great if the q:queryparameter URL parameter would directly open the correct record without the need to refresh the Inbox, as long as the relevant record is already in the Inbox. If that is not possible, the documentation for q:queryparameter should mention that update=true must be included in the URL to open a specific record in the Inbox.

View solution in original post

Skyler
by
New Contributor III

In line 5, you need to specify that there is a query parameter q:globalId with the value $feature.GlobalID. What you've specified above is a query parameter q with the value 'globalid='+$feature.GlobalID. Try this instead:

var urlsource = 'arcgis-survey123://?';
var params = {
  itemID: 'd27d6fc327754039b87a62eae3042092',
  action: 'edit',
  'q:globalId': $feature.GlobalID,
  folder: 'inbox',
  update: 'true'
};
return urlsource + UrlEncode(params);

Note that the property name q:globalId must be enclosed in quotes since it contains a special character other than _ and $. Also note that I've capitalized the I in q:globalId to match what's shown in the documentation; I believe you have to capitalize the query parameter that way, regardless of the capitalization of you actual global ID attribute.

View solution in original post

16 Replies
Shwu-jingJeng
Esri Regular Contributor

Hi Jamie,

With 3.11 version of the field app, we are having issue with edit mode using the URL partameters. We had a backlog issue for this and will try to address this in the next release.

In the meantime, I'd suggest you to contact Esri Support. Our Support team will assign an official bug number for your records. This number can be used to search for and subscribe to the bug on the Esri Support site. If the issue is reported by other customers it will be attached to the same bug report, which helps us assess the impact of the issue and prioritize it accordingly.

 

Thanks,

0 Kudos
David0044
New Contributor II

Was this resolved in the latest update?  Also, do you have a working example as requested in the OP?  I have the same issue/question.

Thanks

0 Kudos
Shwu-jingJeng
Esri Regular Contributor

Hi David,

This issue is still in our backlog list. You may track the status from this salesforce issue. Our internal issue covers all the cases using custom URL parameters, and when the fix is availalbe, it will be included in this salesforce.

BUG-000137679 ArcGIS Survey123 3.11 field app opens the inbox instead of an individual form when the query parameter is used in the custom URL.

0 Kudos
RonParis
Occasional Contributor

Hi @Shwu-jingJeng 

Is there an update on BUG-000137679 please?

Many thanks

Josh

0 Kudos
ChelseyAiton2
New Contributor III

Thank you for providing the specific URL parameters. Though it doesn't automatically open the survey, if you refresh the inbox it will provide the correct survey as the only item to select in the inbox. Which is a couple more user actions than necessary, but does get the job done.

I had been attempting to use the following, which does work but the survey has to already be in the inbox. When you refresh the inbox it loads all the surveys, or just those in the map extent depending upon how you load them. (Lots of extra steps to do this)  So, while still not perfect, it is slightly better than what I had. 

arcgis-survey123://?itemID=<item ID>&amp;action=edit&amp;folder=inbox&amp;update=true&amp;filter=globalId:{globalId}

Does anyone know how this workflow would work Offline, if the survey is not already loaded to the inbox?

Also, wondering if anyone has successfully gotten callbacks to work when finished editing an existing record.

Thanks,

Chelsey

0 Kudos
JamieLambert
Occasional Contributor III

Status of BUG-000137679 'Under Consideration'

BUG-000137679.jpg

 

0 Kudos
Skyler
by
New Contributor III

BUG-000137679 is marked fixed as of version 3.14, but I still encounter the issues described in the original post when using 3.14 on both Android and Windows. If the bug is fixed, a response to this request from the original post would be appreciated:

Does anyone have a working example of using the q:queryparameter URL parameter to launch Survey123 (Windows or iOS/Android) [edit]from a pop-up and open an existing survey for editing?

Thanks,

Skyler

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Apologies for the delay in reply.

 

The Survey123 documentation shows how the q:queryparameter URL parameter can be used:

q:queryparameter - Queries the feature layer for an existing record. It can be used to retrieve content that is not on the device.

 

Examples:

q:where=ws_stationnumber=5171

q:where=waterbodytype='Lake'

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

0 Kudos
Skyler
by
New Contributor III

Thanks for the reply,  @JamesTedrick. I was aware of that documentation page; the reason I asked for a working example is that I was running into the same issue as the original poster:

So far my attempts get me as far as the Inbox, but I cannot load the form with a specific record to edit.

After further testing, I've found that when I open a link on my Android device it will take me directly to the correct record to edit as long as I include update=true in the URL, as in

https://survey123.arcgis.app?itemID=<item ID>&action=edit&q:where=ws_stationnumber=5171&update=true

However, this link does not work for me on Windows, in that it will not directly open the correct record for editing (switching the link to use the arcgis-survey123:// URL scheme also doesn't work). I have still not found any way to create a q:queryparameter link that works on Windows. I think the problem may be that update=true is not having any effect on Windows, which may be a separate bug.

It would be great if the q:queryparameter URL parameter would directly open the correct record without the need to refresh the Inbox, as long as the relevant record is already in the Inbox. If that is not possible, the documentation for q:queryparameter should mention that update=true must be included in the URL to open a specific record in the Inbox.