Select to view content in your preferred language

Using Filter Widget in Experience Builder to select the minimum value of a field

224
3
a week ago
user74562
Occasional Contributor

I am using a filter widget in experience builder that I want to automatically select the minimum value of an attribute field (for the sake of this post, let's say it's OBJECTID). The reason for this being that as the feature layer in the map updates, the filter widget will reduce what's visible on the map in experience builder to whichever row has the lowest OBJECTID value. 

I could write this in SQL easy enough, the problem I'm encountering is that SQL Expressions for filtering can only be constructed in the SQL Expression Builder, which does not enable filtering by minimum / maximum values. Interestingly, I can see the SQL code underneath the SQL Expression Builder after making other filters, but cannot edit it. 

Is there a way to edit this code, and if not, does anyone have any recommendations on how to use the filter widget to select the minimum OBJECTID value in a feature layer? Thank you for any advice. 

 

 

 

 

0 Kudos
3 Replies
ZachBodenner
MVP Regular Contributor

At this time you cannot write/edit the SQL in the filter widget, though it has been suggested already as an idea, so I definitely recommend going over and giving it a kudo because it would be really useful!

0 Kudos
AlixVezina
Esri Regular Contributor

A workaround could be the following:

  1. Create a Data View for the feature layer.
  2. When you configure the Data View, Sort using the field with your values (e.g., ObjectID), and choose to Sort ascending or Descending. In the case of ObjectID, Ascending would give you the smallest values listed first.
  3. Under Records, set the Maximum record count to 1. So now, you'll always only have one record in this data view, and it will always be the record with the smallest value.
    AlixVezina_1-1728509852467.png
  4. Then you can use this Data view in a widget, like the List widget for example, and setup an action to filter all the data records when you select the feature in the List (remember, you'll only have the one feature with the smallest value listed). The fun thing is, you can write any text in the List widget and use it as a filter widget thanks to the actions.
    AlixVezina_3-1728509991096.png AlixVezina_2-1728509971867.png

     

KatyShea
New Contributor

Great workaround!  Thanks for sharing and instructing.  I've used data views similarly to make workaround text indicators numbers and feature boxes.  I miss Dashboard indicators!