Select to view content in your preferred language

In Dashboard List widget, return multiple field names via FeatureSet

213
1
Jump to solution
04-29-2024 07:15 AM
Labels (1)
rwrenner_abtglobal
New Contributor II

In a dashboard list, I'm using the following data expression to return distinct project names:

var projects = FeatureSetByPortalItem(Portal("https://www.arcgis.com"), "ITEM_ID", 1, ['project_name','status','FIELD1','FIELD2'], false)

//filter records to show in output
var status = 'Active'
var just_active = Filter(projects, "status = '"+status+"'")

//return FeatureSet of distinct project names
var proj_distinct = Distinct(just_active, ['project_name'])

return proj_distinct

Right now, project_name is the only field that's available in the List widget:

rwrenner_abtglobal_0-1714399837163.png

I want to modify this expression such that it returns more field values, FIELD1 and FIELD2, as these need to be filtered on. For a given project name, each of these other field values will match, meaning there would be only one value returned per field per project. How might I return more fields in the resulting FeatureSet? 

Tags (2)
0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Esteemed Contributor

Distinct can take a list of fields. Try

var proj_distinct = Distinct(just_active, ['project_name', 'field2', 'etc'])
- Josh Carlson
Kendall County GIS

View solution in original post

1 Reply
jcarlson
MVP Esteemed Contributor

Distinct can take a list of fields. Try

var proj_distinct = Distinct(just_active, ['project_name', 'field2', 'etc'])
- Josh Carlson
Kendall County GIS