Select to view content in your preferred language

Copy inbox survey to new survey and maintain relationship to parent

1012
4
Jump to solution
08-25-2023 08:49 AM
erica_poisson
Frequent Contributor

Hi -

Hoping for some help in resolving a workflow issue. We are building a new dam inspection form. We have a dam inventory (point) with a 1:M relationship to an Inspection table. Because the inspection form is very long and does not change much from inspection to inspection, we want users to be able to easily copy the previous inspection into a new form, make updates and submit. The relationship between the Dam points & inspection table is based on GlobalID/GUID; this has already been published as a hosted feature layer (AGOL). 

I've tested two workflows which both have benefits and drawbacks. I am hoping for some advice on how to accomplish my goal. 

GOAL: Easily copy previous inspection to a new form AND maintain the relationship to the Dam point. 

Workflow A: Use Survey123 Inbox w/ the following settings - inbox surveys to be viewed (no editing of previously submitted inspections), allow inbox surveys to be copied to a new survey. THIS DOES NOT MAINTAIN RELATIONSHIP -- when I tested, the GUID is not populated with the Dam's GlobalID, hence relationship is broken. This is ideal because the entire form is copied and the user can make updates and submit a new inspection. 

Workflow B: Use Survey123 form that contains dam information and all inspections conducted. Allow editing via Inbox. Can view previous inspections, but not edit them. Can add new inspections. Can not copy past inspection into new repeat. MAINTAINS RELATIONSHIP -- when I tested, the GUID is populated with the Dam's GlobalID and relationship is maintained. This is not ideal because while I can view the previous inspections, I can not select the most recent and copy it to a new repeat. 

Potential Workaround: Use Workflow A to trigger Power Automate on submission. Power Automate grabs the GlobalID of the dam using another unique identifier and writes the GlobalID to the inspection's GUID field. This would work, however I am wondering if I am missing something obvious that would be a better solution. 

Thank you,

Erica
0 Kudos
1 Solution

Accepted Solutions
erica_poisson
Frequent Contributor

Using pulldata("@layer") works well to solve this issue, however I still think this could use some finessing from the Survey123 team to make this work without pulldata...

Some cleaning up needed, but as a proof of concept, this supports Workflow A above, which is what I was hoping for as I need to support reinspection of assets with extremely long inspection forms. 

erica_poisson_0-1693235979087.png

 

Erica

View solution in original post

0 Kudos
4 Replies
jcarlson
MVP Esteemed Contributor

Is the "dam_guid" exposed in the surveys in the inbox?

A couple ideas occurred to me:

Field Maps

You can use Field Maps as your "inbox" and use Arcade to populate a URL with the values you need, then add that URL to the inspection popup. Search for / click on a dam in the map, choose a related record, then use the URL to "copy record to new inspection".

We do something like that for our restaurant inspections, actually.

Using the pulldata("@layer") function

If there was a field in the form that let you search for the dam by ID or something similar, you could have the form find the GUID and pull it in. Hacky, but it could work.

- Josh Carlson
Kendall County GIS
erica_poisson
Frequent Contributor

Hi Josh,

We use the Field Maps solution for many of our inspection workflows, and it's great, however this survey is extremely long and detailed. It would just not be possible to use this for this situation. 

I actually thought of pulldata last Friday and plan on trying it this week. I think that will work and might be the best option for grabbing the proper GlobalID and writing it to my "dam_guid" field to solidify the relationship. 

@IsmaelChivite  It would be great if it was possible, within a repeat, to view the most recent repeat record and just copy that to a new/editable repeat record and use that to edit the inspection form (Workflow B above). 

Erica
0 Kudos
DougBrowning
MVP Esteemed Contributor

You could add a second relationship class that you manage.  You could base this on your own key and not use the globalids.  If you ever export or import to SDE the globals usually break anyway.  You can leave the 123 one there just add a second.  I do something similar.  Writeup is here  https://community.esri.com/thread/221263-mapping-with-survey123-within-a-polygon-or-admin-unit

Just an idea

0 Kudos
erica_poisson
Frequent Contributor

Using pulldata("@layer") works well to solve this issue, however I still think this could use some finessing from the Survey123 team to make this work without pulldata...

Some cleaning up needed, but as a proof of concept, this supports Workflow A above, which is what I was hoping for as I need to support reinspection of assets with extremely long inspection forms. 

erica_poisson_0-1693235979087.png

 

Erica
0 Kudos