Select to view content in your preferred language

Expand and Collapse Groups via Arcade Expressions

681
3
06-30-2023 09:50 AM
Noah1
by
New Contributor

Hello. I am setting up a field map and form to be used for collecting tree variables for a set of plots we have laid out. Currently, my form is set up so that when you arrive at a plot you are required to fill in a few variables for the first tree of that plot. At the bottom of the "Tree 1" group there is a switch that you flip to "Yes" if there is another tree within that plot to record data for. When that switch is flipped to yes, the "Tree 2" group become visible through conditional visibility. 

What I want to know is if there is an additional expression I can add that will automatically collapse the "Tree 1" group once that switch is flipped to yes. That way the group still remains visible but takes up less screen space for the collectors and saves time on them having to scroll all the way up to collapse it themselves.

Thanks for any input!

0 Kudos
3 Replies
ChristopherCounsell
MVP Regular Contributor

No, the 'initial state' of collapsed/expanded only allows for the initial state. It can't be dynamically updated like the 'conditional visibility' group setting.

https://doc.arcgis.com/en/field-maps/android/help/configure-the-form.htm#ESRI_SECTION1_EFBFAC02309B4...

Currently you are filling out multiple fields in one table. It's a 1-M relationship within the one table, that requires you to have the fields for the additional trees. This may work if you know you are going to capture a consistent amount of trees. But really you should consider revising your data structure so that you are creating each tree as a new record in the table. e.g.

  • Have a layer for the plot and related table for the trees (if you don't need geometry for the tree). Add trees into the related table using Field Maps or Survey123 via a custom URL
  • Have a layer for the plot and related table with geometry for the trees. Use a custom URL to launch survey123 to add related records against the plot.

These workflows let you add as many trees against the plot, and you can retain relationships if you use the relationsip class or custom url schemes to pass parentglobalids or plot ids.

0 Kudos
DylanKennard-tt
Occasional Contributor

I am looking for the same solution regarding collapsing. I guess we need to add it as road map idea.

Just to note I launched ESRI Field Maps with relationships. The field users didn't like it as you have way less visual control. It's a tiny little button and it is stuck in one spot. It's also only possible once the geometry main feature is collected. You then need to go "edit" the feature you just made. As a result technically relationship classes are the way to go but ESRI needs to create a lot more options in Smart Forms to make it more viable to the end users.

 

Survey123 and Collector are being deprecated in 2024. Don't jump into that!

0 Kudos
ChristopherCounsell
MVP Regular Contributor
Survey123 is not being deprecated.
Collector was retired a year ago.
0 Kudos