Access to objectid generated by Survey123

1716
8
08-23-2019 06:29 AM
deleted-user-sNUdtFrn2yEY
New Contributor III

Hello -

I'm hoping you can assist me with trying to access the objectid info that is generated when a survey in Survey123 is submitted. I can see the objectid in the Feature Layer Field list, but I'm not able to see it when it comes into the Survey123 Report or in the Data view in Operations Dashboard. I'm working with a colleague who uses this "unique id" as a way to track his projects. I see in the MS FLOW Webhooks you can access the Feature objectid, that's the only place that I can see it is available. We don't want to edit the objectid, we just want to use that as the main identifier when a survey has been submitted.

My issue is a Project nr. or Work order nr. may be used multiple times and is not unique enough for this scenario, that is why he is using the "unique id" that is automatically generated from the Intergraph survey app.

If accessing the objectid is not the right way to go, is there another way that I can generate a "unique id" that is automatically generated, accessible and visible that would do the trick when a Survey is submitted in Survey123?  

Thanks in advance and any tips or best practices you could suggest for my question would be greatly appreciated.

Best regards,

Colleen M. Schelde

Orsted/Radius Elnet

comas@orsted.dk

Tags (1)
0 Kudos
8 Replies
YuliaMamonova
Occasional Contributor III

Hi,

I would suggest:

1) create an empty hidden text field in your survey 123 form

2) create a scenario in integromat with watch surveys trigger and make http request POST module. The syntax is as following:

 

After the survey is submitted, the scenario will be triggered and your empty text field will be updated with a valid object id number for that survey, so you can include it into the report.

YuliaMamonova
Occasional Contributor III

If your survey is not public, you would also need to have token field:

key: token

Value: (you can add it from watch surveys module)

0 Kudos
deleted-user-sNUdtFrn2yEY
New Contributor III

Yulia -

Thanks for your input. I plan on using Microsoft Flow to set up the webhook. I'm also using Survey123 Connect to set up the survey. I was hoping to just be able to generate it via a calculate formula, but I'm not so clever as to how to exactly write it. Any suggestions would be helpful.

Colleen M. Schelde

Orsted/Radius Elnet

comas@orsted.dk

0 Kudos
YuliaMamonova
Occasional Contributor III

As far as I know, there is no way to capture Object ID before the survey is submitted. May be someone can help you with calculating it in excel form ( for example, with JS function, so you can pull the count of existing features in your Survey123 feature layer, and add 1 to that number).

But as for me the way I proposed is much easier.

If you only start working with webhooks I highly recommend to switch from MF to Integromat, for example you can automate feature reports generation with Integromat only.

YuliaMamonova
Occasional Contributor III

Ok, so I thought about it a little bit more, and calculating Object Id in the form before it's submitted is a very bad idea, because imagine 1 person started the survey, but haven't completed it yet, with JS function you are pulling the count of submitted records, and add 1, so it looks like you captured the next Object Id, but someone else started another form before that previous form was submitted, and JS function will return the same Object Id for this form, because that 1st survey wasn't submitted yet. So when both surveys are finally submitted you will come up with 2 same "unique" numbers.

This is why object id cannot be captured before the survey is submitted.

Hope it helps.

PanGIS
by
Regular Contributor

Hi @YuliaMamonova I thought you answer would have solved my issue but not.

here is my http module. everything looks fine but after I send the survey the field is still empty. do you see any error?

thanks!

PanGIS_0-1621260001017.png

PanGIS_1-1621260125677.png

 

 

0 Kudos
YuliaMamonova
Occasional Contributor III

Hi, I think there might be a problem with your URL, which should look like this:

https://services9.arcgis.com/##########/arcgis/rest/services/service_##################/FeatureServer/0/updateFeatures

Here is the post from Ismael, which explains how to construct a URL: 

YuliaMamonova_0-1624318091111.gif

 

0 Kudos
DougBrowning
MVP Notable Contributor

Why not use the globalid?  And/Or GUID.  Not sure if you can calc a GUID in a form.  Objectid changes all the time on export and import.

In our old Access DB they created unique keys bases on date, time, milliseconds but I never loved that way.

0 Kudos