Generating repeat summaries in a note field

1372
8
03-31-2022 03:49 PM
RyanDurand2
New Contributor

hello, 

I am trying to create a summary of repeat records in a S123 survey in a note field. The goal of this is to be able to provide the user with what has been entered so they can reference information as they add more repeats. I have looked all over and have had some success with the join() and concat() function but the load times are poor when switching pages while using a phone or tablet. This summary will not need to be retained in the feature layer after form submission which is why I am using the note field to display the summary. 

What I need in the summary is the repeat number, a couple integer fields and text fields that are separated by a "/" or "I"

In a perfect world I would have this information formatted into a table using HTML formatting but that is a bit out of my realm of understanding. If this is feasible it would be preferable.  

Any help or tips on making this work smoothly is appreciated! 

exls and csv's are attached. There are summaries being made for three of the pages (organic, mineral and species list) 

Thanks for any help! 

 

0 Kudos
8 Replies
DeonLengton
Esri Contributor

Hi Ryan

You should be able to achieve this with html by using a note field with a table in html:

<html>
<table border=1 width=100%>
<tr>
<td>
<strong> Heading </strong>
</td>
</tr>
<tr>
<td> Some information 123 </td>
</tr>
<tr>
<td> Other information 234 </td>
</tr>
</table>
</body>
</html>

Regards

Katie_Clark
MVP Regular Contributor

Hi @DeonLengton , will this method work if the data is in a repeat, so we don't know exactly how many rows we need? Or is it only possible to hardcode the number of rows using this method?

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
0 Kudos
Katie_Clark
MVP Regular Contributor

@RyanDurand2 I've done something very similar, just using concat and join. I used this method because the data summary the users wanted was for data entered in a repeat, so the number of rows needed would vary from survey to survey.

A quick note/tip - make sure you set the field length to a very high number (I ran into issues with the string truncating and throwing an error when more records were entered in the repeat than I anticipated) and also set the field type to null so it won't appear in your feature layer's attribute table. 

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
RyanDurand2
New Contributor

hello @DeonLengton 

As Sarah has asked, how does this work within a repeat? This note populates well from the information I enter for a single row but when I add additional repeats it simply overwrites the previous entry so I can only see the current repeat that is open. 

 

What I need is for each new repeat to add in a new row to build the table longer. I also need to have the data populate in columns and not just down the rows. How is this coded using HTML? The screenshot below will give you a clearer idea of what I am trying to accomplish. Where Attributes1-3 are all within a repeat

RyanDurand2_0-1648829378743.png

Thank you very much for the help, 

0 Kudos
DeonLengton
Esri Contributor

Hi

Sorry for the delayed response.

I would look at generating the HTML table in a JavaScript function for each repeat value.

I will see if I have time to give it a try in this week.

0 Kudos
GilMastrapa
New Contributor III

@RyanDurand2  @DeonLengton  @Katie_Clark 

Did you manage to accomplish this?? Really needing something like this. 

Still using a note field with HTML? How did you manage for variable number of rows??

 

0 Kudos
MeganEngel
Occasional Contributor II

How does this type of summary at the end of a form work when you need the form to be compatible with the web-based version of the form?  I am kind of stumped of how to deal with a repeat I would like summarized on the last page before a user submits the record.  I pretty much need something like this:

 

Name:

Contact Info:

Facility Location Info: --everything below here would be from the repeat, and each record populated--

     Location Name:  XXXXXX

     Number of Points of interest:  XXXXXX

    Points of interest Total (a calculated number):  XXXXXX

    Attribute A: XXXXX

    Attribute B:  XXXXXX

   (X however many records I have in the repeat)

Thank you!

0 Kudos
MeganEngel
Occasional Contributor II

@RyanDurand2@GilMastrapa 

So I worked through this yesterday, and here is the version I came up with.  It doesn't come out as a pretty table though.  This isn't the final version of how I am wanting this to look, but it gets me into the ballpark.

So within the repeat, I added another string field (1000 char) that essentially is my join summary, note I have an if statement because how I want the summary to generate is different based on a yes/no field:

 

 

 

if(selected(${OtherGrowersInBins}, 'Yes'), 
   (concat(${locationcounter}, ' -- ', ${FacilityAltID}, ' - ', ${NumBins}, ' bins (', ${StorageCapacity}, ' bu per bin) | ', ${OtherGrowersInBins}, ', other growers using this location: ', ${OtherGrowersInBins_Names})),
   (concat(${locationcounter}, ' -- ', ${FacilityAltID}, ' - ', ${NumBins}, ' bins (', ${StorageCapacity}, ' bu per bin) | ', ${OtherGrowersInBins}, ' other growers using this location.')))

 

 

 

So now that each new record in the repeat has a summary field that is putting together the info I need, in a note field on the last page of the survey, I have the join() function:

 

 

# JoinSummary is the field from the repeat which concat() was used to string all info together

join("\n\n", ${JoinSummary})

 

 

 

Here is an example of what the final output would be:

MeganEngel_0-1703863662522.png

Hope this helps!

0 Kudos