Dynamic Populating Repeat Sections using Pulldata(@"layer") from last reads

1299
2
Jump to solution
12-05-2022 02:46 PM
AnaDeniston
New Contributor III

Hello All, 

I work with several Survey123 forms that need to visualize previous reads. One of my challenges was to read previous data submitted to the same survey in Repeatable questions. 

I was able to create a form that fills in the information in repeat and regular questions using pulldata(@"layer") - (Attached is the Xlxs form).

More info about this:

- Survey123 Tricks of the Trade (Live): Query ArcGIS layers with pulldata("@layer")

- Survey123 Tricks of the Trade: pulldata("@layer")

- Query a feature layer

Important: Lines 2/3 must be updated after publishing the form with the URL of the feature layer and the URL of the repeatable table. 

AnaDeniston_0-1670279462095.png

Also, it was very important to have in the repeat section in bind::esri:parameters - calculationMode=always.

This allows the answers in the repeat to change according to the index. 

AnaDeniston_1-1670279705806.png

I am sure there are several improvements that can be implemented to this form. This was the solution that I came across and I am open to new suggestions. 

Thank you all, I hope this is helpful 🙂

 

Ana

 

1 Solution

Accepted Solutions
IsmaelChivite
Esri Notable Contributor

Hi @AnaDeniston Thanks for sharing your findings! Another approach to prepopulate records in a repeat is to use the query parameter in the bind::esri:parameters column of your XLSForm. For example:

IsmaelChivite_0-1683837777929.png

In the above example, all Circuit Breakers for the Electric Panel will show in your repeat when you open the Electric Panel from the Survey123 Inbox.  This is because the circuits repeat is set with the query parameter in bind::esri:parameters.

Using the query parameter has its advantages: The XLSForm syntax is pretty simple. It works, even if you are offline and it is quite flexible:

If you do not want to load all Circuit Breakers into the repeat, you can also use a filter. For example, if you only want to populate repeat records where the status is needs repair:

IsmaelChivite_2-1683838191594.png

Using additional parameters you can even control if records should be in read-only mode or not. For example, you may want to display previous inspections in read-only mode and allow updates to new inspections.

There is a bit more info about this here: https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-repeats/ba-p/89804...  and also in this video recording from the Esri Developer Summit: https://mediaspace.esri.com/media/t/1_rge1ajj8 

 

View solution in original post

2 Replies
IsmaelChivite
Esri Notable Contributor

Hi @AnaDeniston Thanks for sharing your findings! Another approach to prepopulate records in a repeat is to use the query parameter in the bind::esri:parameters column of your XLSForm. For example:

IsmaelChivite_0-1683837777929.png

In the above example, all Circuit Breakers for the Electric Panel will show in your repeat when you open the Electric Panel from the Survey123 Inbox.  This is because the circuits repeat is set with the query parameter in bind::esri:parameters.

Using the query parameter has its advantages: The XLSForm syntax is pretty simple. It works, even if you are offline and it is quite flexible:

If you do not want to load all Circuit Breakers into the repeat, you can also use a filter. For example, if you only want to populate repeat records where the status is needs repair:

IsmaelChivite_2-1683838191594.png

Using additional parameters you can even control if records should be in read-only mode or not. For example, you may want to display previous inspections in read-only mode and allow updates to new inspections.

There is a bit more info about this here: https://community.esri.com/t5/arcgis-survey123-blog/survey123-tricks-of-the-trade-repeats/ba-p/89804...  and also in this video recording from the Esri Developer Summit: https://mediaspace.esri.com/media/t/1_rge1ajj8 

 

AnaDeniston
New Contributor III

Thank @IsmaelChivite for taking the time to share your solution.

0 Kudos