Pull ObjectID Survey123

4439
6
Jump to solution
11-14-2018 07:57 AM
joerodmey
MVP Alum

Need to calculate to pull the objectID from the Survey. Tried ${objectId} with no success.

0 Kudos
1 Solution

Accepted Solutions
JohnathanHasthorpe
Esri Regular Contributor

Hi Joe

The objectid for a survey feature is only allocated when the survey is submitted - as it is created by the server. It is therefore not possible to display this in a new survey. 

Additionally, you can't include the objectid field as a question when creating a survey from an existing service. However, we do have an enhancement request open to allow the field to be displayed in the form.

View solution in original post

6 Replies
JohnathanHasthorpe
Esri Regular Contributor

Hi Joe

The objectid for a survey feature is only allocated when the survey is submitted - as it is created by the server. It is therefore not possible to display this in a new survey. 

Additionally, you can't include the objectid field as a question when creating a survey from an existing service. However, we do have an enhancement request open to allow the field to be displayed in the form.

by Anonymous User
Not applicable

Johnathan Hasthorpe wrote:

you can't include the objectid field as a question when creating a survey from an existing service. 

Thanks for the helpful information Johnathan Hasthorpe‌. Do you know if this would apply to all reserved fields? For instance, is it possible to put the "Creator" field (collected through editor tracking) in a survey form on an existing feature to expose the username who created a feature?

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Shannon,

Unfortunately, since the editor tracking fields are marked as non-editable, they can not currently be included in a form, even in a read-only context.

by Anonymous User
Not applicable

Thanks for confirming the expected behaviour here, James. Much appreciated.

0 Kudos
RobBlash
Occasional Contributor III

Johnathan Hasthorpe‌ or James Tedrick‌ it it possible yet to display the OID on a form? Specifically, I want to show the OID for records opened via the inbox so I can access it and link to the survey123 site to review existing photos. This would be a form built on an existing HFS.

Use Case:

A Production survey is used to submit data

A QA/QC survey (built on HFS from above survey, with a few additional QA/QC comment fields) is used to review data. I would like to hyperlink to the record in the S123 site to easily view photos (example: https://survey123.arcgis.com/surveys/MySurveyID/data?objectIds=495)

Is this possible?

0 Kudos
MJBiazar
Esri Contributor

Hi @RobBlash, it is not possible to have ObjectId as a question when publishing a survey. Whether if you publish a new survey or use a submission URL to an existing feature service, you won't be able to publish and you'll get an error.

This is expected since the ObjectId field is essentially a non-editable field and besides ObjectId only gets created after you submit a form. 

2021-12-17_16-38-35.jpg

 

However, you may need to use the ObjectId of your existing submissions on your form for different reasons. For instance to append the ObjectId to a URL to create a link to send a query request or generate a link to Survey123 website and select a submission using the ObjectId parameter. 

 

2021-12-17_16-47-08.jpg

 

There is a workaround that enables you to pull ObjectId of existing features and pass it to a field on the form and use it in calculations as needed when editing existing survey submissions. In order to do this, you can add a question (with any type such as text, integer)  to show ObjectIdss. The name for this field should match the name of the ObjectId field of the feature layer (case sensitive). You also need to set the bind::esri:fieldType to "null". By doing this, you will be able to publish your survey without any errors.

 

2021-12-17_16-33-52.jpg2021-12-17_16-32-32.jpg2021-12-17_16-29-50.jpg2021-12-17_16-31-22.jpg 

Best, 

MJ