Select to view content in your preferred language

Nested Repeats Configuration

3068
5
Jump to solution
10-27-2020 02:47 PM
ElizabethHovsepian
Regular Contributor

We have a situation where we have multiple trees being trimmed at one location.  We want to have one survey per day, to have multiple locations.  Each location will have multiple tree info.  So the location should be a repeat for the day and each location should have 1 or more repeats for tree info associated with  it.

 

Survey Date 10-27-20

      101 First St

                Pine

                Alder

      103 First St

                Oak

                Maple

How would we set that up?  We would like to know how to set up a nested repeat to match the above example.

 

Thanks, Elizabeth

0 Kudos
2 Solutions

Accepted Solutions
by Anonymous User
Not applicable

Hi Elizabeth,

Yes, this should be possible and the way you based on the workflow.

The parent layer should be the day/date layer with associated fields to the date, user and other detaisl you want to collect related to that day and the crew.

The first repeat related to the parent needs to be a location layer and include a geopoint question and address questions to capture the location and other related data.

The next repeat which will be nested inside the first repeat above (location layer) would then contain the tree information. It would look something like:

parent layer

date

crew

etc

     begin repeat - location layer

     geopoint question

     address details etc

            begin repeat - trees table

                  type of tree

                  tree details

            end repeat

      end repeat

Hope this helps

Regards,

Phil.

View solution in original post

by Anonymous User
Not applicable

Hi @KarimNaguib,

Where do you want the sum() data to be stored, in the nested repeat of the values you are summing, in the parent repeat, or the parent layer? The sum() can only be used outside of the repeat you are trying to sum().

Another way to do this is using a JS function.

Regards,

Phil.

View solution in original post

5 Replies
by Anonymous User
Not applicable

Hi Elizabeth,

Yes, this should be possible and the way you based on the workflow.

The parent layer should be the day/date layer with associated fields to the date, user and other detaisl you want to collect related to that day and the crew.

The first repeat related to the parent needs to be a location layer and include a geopoint question and address questions to capture the location and other related data.

The next repeat which will be nested inside the first repeat above (location layer) would then contain the tree information. It would look something like:

parent layer

date

crew

etc

     begin repeat - location layer

     geopoint question

     address details etc

            begin repeat - trees table

                  type of tree

                  tree details

            end repeat

      end repeat

Hope this helps

Regards,

Phil.

ElizabethHovsepian
Regular Contributor

Thanks for the quick reply, Philip.  I finally got it to work following your example and some trial and error.  It was a bit challenging for me because I had groups in the survey as well.

Elizabeth

KarimNaguib
Occasional Contributor

This is really helpful Phil, thanks.  Is there a way to summarize on the data within the nested repeat though?  I have a similar survey, but the repeated data are costs rather than tree type/details.  I can get an accurate Count(), but when I do a Sum() on the field, it returns what looks like maybe a concatenation of the data rather than a sum.  My form is attached (other than external tables).  the green section is where I'm having issues, and the blue section is the greater repeat.  I even included a hidden field within the repeat to summarize on, then on my summary page, I tried pulling from that hidden field, but it still doesn't properly sum the repeated records.  
Any insight would be appreciated.  Thanks,
Karim

0 Kudos
by Anonymous User
Not applicable

Hi @KarimNaguib,

Where do you want the sum() data to be stored, in the nested repeat of the values you are summing, in the parent repeat, or the parent layer? The sum() can only be used outside of the repeat you are trying to sum().

Another way to do this is using a JS function.

Regards,

Phil.

KarimNaguib
Occasional Contributor

Thanks Phil,

I want the sum() data to be stored outside of the repeat.  I had a hidden field inside the repeat that I was using to sum on, and then outside of the repeat I was running another sum() on that hidden field.  That field was bound as a decimal, but I just moved it to outside of the repeat and it seems to be working now, thanks Phil.