Way to summarize existing items inside a repeat?

3157
11
10-16-2018 07:03 AM
JeffJackson4
New Contributor III

Is there a way to summarize, as a list, certain items from within a repeat?  Say using a note field?

For example, we want to do repeated surveys (weekly) at locations.  So we have a single form where the main part of the form contains key data for the site (location, name, structure ID, etc.).  Then the second part of the form has a repeat for each of the weekly inspections.

When something is amiss, it is marked as a "priority item" in a given weekly report.  The problem is that unless you scroll through each of the previous surveys (as many as 50 or more), and view every potential item type on said form, it is very difficult to see what the items that need addressing are, and if they have been addressed, close them out.

What we would like to do is have a summary in the main body of the form that lists these priority items in a format like as follows.

Priority Items:

Description                                     Priority                                       Date Open         Date Closed

Problem #1                                       High                                            08/23/2018         09/06/2018

Problem #2                                       Medium                                      09/06/2018

Problem #3                                       Low                                            09/13/2018

Where things like "Description", "Priority", "Date Open", and "Date Closed" are all fields within the repeat.

This way, the inspector can quickly see what needs to be looked at.

Thanks.

11 Replies
ClayDonaldsonSWCA
Occasional Contributor II

This is possible! What you need to do is have a hidden calculation field within the repeat that holds either a 1 or null.

Then use the sum() function to add all the records together. For example, a repeat with a 'high' priority would have a hidden count field set to 1 and medium/low count fields set to null.

Oh and the bind:type set to int is important, the function will not work otherwise. This is a different column from the esrifieldtype column!

typelabelCalculationbind:type
begin repeatr1
select_one prioritypriority
hiddenpriority_high_count
int(if(selected(${priority},'High'),1,''))
int
hiddenpriority_medium_count
int(if(selected(${priority},'Medium'),1,''))
int
end repeatr1
noteHigh Priority Countsum(${priority_high_count})
noteHigh Medium Countsum(${priority_medium_count})

You can then display the resulting sum as a note, use as a constraint, add additional repeats etc. 

0 Kudos
JeffJackson4
New Contributor III

Thanks.  But I don't think this will actually display the results like I want above.  It will just display a "count" of each type of priority item.  I'm already doing this elsewhere on the form for other reasons.

If there are 4 high priority items, this will tell me there are "4".  But none of the other information gets passed through.

What is needed is a summary of what the open item entails.  Because of the way repeats work, they don't display as a list (unless I've missed that option).  They display as a single item with the ability to scroll to the next or the previous.

One workaround, which is cumbersome and not practical for large sites with many visits, is to have a series of priority item questions and inputs not as a repeat, but as a selectable and additive list through a "add another" Y/N command.  But ultimately you get limited in how many you can add.

That's why I'm looking for this workaround since repeats are much cleaner.

This is what I need to see.  But not just for the selected instance of the repeat.

If I move to the next instance, I no longer see this one.  I need to see them all under the "List of Priority Items" note field regardless of which instance is selected.

Thanks.

0 Kudos
ClayDonaldsonSWCA
Occasional Contributor II

Ah I misunderstood!

So you are attempting to recreate that table, hmmm. Something I have also struggled with re-creating without affecting performance. I agree the many duplicated attributes with Y/N is quite cumbersome.

You could tie a geopoint question to the repeat, then each repeat would have a point record which could be configured  in another app such as workforce,collector or explorer. It could just be a duplicate of the initial coordinates. Then when someone clicked/tapped on that spot they would see all the records. I have done something similar for one of my surveys.

That would have to depend on the nature of the work though (do they need the info during that visit? Or would it be for returning visits?) and connectivity. Workforce actually sounds like it might work for what you are attempting. 

Unfortunately I don't think this is currently possible in survey123. I believe ODK has this functionality and I'm sure it will be added to Survey123 eventually (Please Esri?)

Good luck!

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Jeff,

We do not have a table view of repeats. I've logged this as a potential enhancement. 

JeffJackson4
New Contributor III

This would certainly be most helpful if it could become an enchancement.  Thanks.

0 Kudos
RogerCleaves1
New Contributor III

Any movement on this enhancement? We have an inspection survey and staff would like to see a summary of what was entered at the end

DougBrowning
MVP Esteemed Contributor

In these workflows I always prefer to have 1 form filled out per visit.  That way you have full editor tracking (date/time and which inspector), GPS (can see if they were in the correct spot) etc.  Use collector to hold the prefilled data like location and such.  Use Collector to launch the form once they get there - filling out the top data for them.  Relationship class the weekly forms back to the points - now can easily see them all in AGOL, Collector, etc..  Users can bring up last weeks report, change a few items and resubmit for each repeated inspections.

Then so many things are easier.  Like your OMG issues are now just symbols on the map.  Plus Ops Dashboard etc all become easy to use. 

I see a lot of people trying to put site visits in repeats and it never seems to flow very well.  The data that is known before you leave makes more sense in Collector then in a field survey.

hope that helps

0 Kudos
JeffJackson4
New Contributor III

We have tried this solution.  Still seems to make it very had to track open items on a site where there may be 10 inspection items and 5 need corrective action.  And then track and ultimately close out items that are resolved.  The problem is that unless you modify the site through the XLS form tied to Survey123, the system does not recalculate important information (such as days an action item is open, etc.)  These are all things that are very important to our clients.

The tracking aspect is very important to our client as this is all for compliance purposes.

When we have multiple forms (or a new form for each visit) and each one may have a different or new item to be fixed, or week after week reporting the same item that has not yet been resolved, this tracking becomes cumbersome and bulky with separate forms.  There's a lot of backend heavy lifting and coding that we have to do just to figure out how to handle all the possible combinations of repeated possibilities to make sure the info our client wants to see is being handled efficiently.

Also, our client is not entirely happy with Collector and we are trying to provide them a separate solution for now through Survey123.

The Dashboard does not work for our client as it does not conform to our client's way of doing reporting.  So we are not using that.

However, if you could further explain how you have resolved these issues, it may help point us in a better direction than the single site form option.

Thanks.

0 Kudos
DougBrowning
MVP Esteemed Contributor

You could use Arcade expressions to calculate some of it probably.  Symbols or definition query could handle some other parts.

But it sounds like you have the common issue of a company wanting to use modern technology but still use there old workflows.  If they are not at all open to changing how they see items (they are probably used to static reports) then it will be a tough go.  A Ops Dashboard could quickly tell them many of the things you mentioned.

For me we had a manager that refused to not get a print out from Survey123.  So I built this whole system to generate a pdf and mail it.  So the field worked filled out on the tablet, got an email, printed it, then walked it over to the mangers desk.  They then complained it was not any easier - well duh!  Then in the end I found that all the manager did was put the paper in a file cabinet - never to be looked at again!  Lot of money to spend just cause someone will not change.

Just my personal view.  Good luck.

0 Kudos