Questions on repeats and/or related tables

942
2
Jump to solution
03-12-2021 01:18 PM
Labels (1)
Mark_Johnson
New Contributor III

Looking for some guidance on implementing a survey for inspections with this general workflow:

  1. Enter contact info, etc.
  2. Choose department from list.
  3. Based on dept chosen, choose facility doing inspections at.
  4. Based on facility chosen, list of assets presented to be inspected. Any number of assets may be inspected, but we want all assets presented so the inspector is aware of what should be inspected.
  5. Inspection questions are the same for each asset.
  6. Some post inspection questions.
  7. Signature/attest

From a database viewpoint, it makes most sense to me to have the main table and a related table with each inspection, like:

NameDeptFacilityDate

 

AssetQuestion 1Question 2Question 3

 

It appears that repeats are needed to work with related tables? If so, is it possible to pre-populate the repeat with the list of assets? And is it possible to display all the repeats one after another instead of with the <> navigation I see in all the examples?

Any advice or alternative approaches appreciated. Thanks

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
IsmaelChivite
Esri Notable Contributor

I can think of a couple of approaches. One which could be ideal, but not technically possible as far as I know, and the second, which is technically possible, but may or may not work for you.

Approach 1: It would be great if the form could follow exactly the workflow you describe, where the initial questions help set the exact facility and once the facility is known a repeat with all the assets in it were displayed.  Unfortunately, it is not possible to prepopulate a repeat like you want when completing a new form.  I just wanted to bring this up front so you do not waste time trying the impossible.

Approach 2: Another approach is to use the Inbox in the field app. By enabling the Inbox you can download all your facilities into the device, and then make edits to them.  Elements in the Inbox can be filtered and sorted by date, alphabetically and geographically to help select the right facility.  Once a facility is selected, the actual form would open and in it, you will find a repeat with the corresponding assets.

To implement Approach 2 you would:

  • Create in Survey123 Connect your form, including a first section for the facility with contact info, department, location of facility, etc. A second section using a repeat for the questions for each asset. It could look something like this:

IsmaelChivite_0-1615595703724.png

  • The bind::esri:parameters cell on the repeat is critical, as it will allow the Survey123 field app to download information about the assets in the facility and allow user to modify them during inspection.
  • You will also want to set a good instance_name expression in the settings XLSForm tab. Something like contact(${facname}," ", ${dacdept}) for example
  • And do not forget to enable the Inbox in Survey123 Connect before you publish.
  • Once published, you will then want to load data in the facility and assets layers
  • Once data has been loaded, download the survey in the app and refresh the Inbox to load the facilities in it. When you open a facility from the Inbox, it will show the corresponding assets in the repeat so you can edit (inspect) them.

 

 

 

View solution in original post

0 Kudos
2 Replies
IsmaelChivite
Esri Notable Contributor

I can think of a couple of approaches. One which could be ideal, but not technically possible as far as I know, and the second, which is technically possible, but may or may not work for you.

Approach 1: It would be great if the form could follow exactly the workflow you describe, where the initial questions help set the exact facility and once the facility is known a repeat with all the assets in it were displayed.  Unfortunately, it is not possible to prepopulate a repeat like you want when completing a new form.  I just wanted to bring this up front so you do not waste time trying the impossible.

Approach 2: Another approach is to use the Inbox in the field app. By enabling the Inbox you can download all your facilities into the device, and then make edits to them.  Elements in the Inbox can be filtered and sorted by date, alphabetically and geographically to help select the right facility.  Once a facility is selected, the actual form would open and in it, you will find a repeat with the corresponding assets.

To implement Approach 2 you would:

  • Create in Survey123 Connect your form, including a first section for the facility with contact info, department, location of facility, etc. A second section using a repeat for the questions for each asset. It could look something like this:

IsmaelChivite_0-1615595703724.png

  • The bind::esri:parameters cell on the repeat is critical, as it will allow the Survey123 field app to download information about the assets in the facility and allow user to modify them during inspection.
  • You will also want to set a good instance_name expression in the settings XLSForm tab. Something like contact(${facname}," ", ${dacdept}) for example
  • And do not forget to enable the Inbox in Survey123 Connect before you publish.
  • Once published, you will then want to load data in the facility and assets layers
  • Once data has been loaded, download the survey in the app and refresh the Inbox to load the facilities in it. When you open a facility from the Inbox, it will show the corresponding assets in the repeat so you can edit (inspect) them.

 

 

 

0 Kudos
Mark_Johnson
New Contributor III

@IsmaelChivite thanks for the detailed reply, saved me from trying things that weren't ever going to work. I haven't gotten to figuring out Inbox yet, but I'll try out Approach 2 and see if it's simple enough for my users.

I didn't really need a spatial component for this, but another alternative I'm thinking of now is a map-centric app, similar to hydrant inspections examples I've seen, showing all the assets around the inspector that haven't been inspected yet this quarter and letting them tap on the asset and start a new inspection. Not to bail to a "competing" product 🙂 but maybe a job for Field Maps instead?

0 Kudos