https://developers.arcgis.com/experience-builder/guide/text-widget/#dynamic-content-panel
Have you looked at the Dynamic Content options in the Text Widget?
Agree this would be really useful. For example, if had a point feature of landmarks with type and county columns, and you want to be able to use filters on the type and get a simple list of the distinct counties where that type of landmark can be found.
Currently the only widget that seems to be able to group by unique/distinct values is the Chart widget, but that format doesn't work for everything.
@JeffreyThompson2 There doesn't appear to be a way to get distinct values out of a text field using that method.
@BlakeMorrison It would be possible to retrieve a single attribute value in a Text Widget using a combination of Data Views and Dynamic Text. Probably not in a useful way or what the OP was actually asking about.
I managed to almost achieve what I wanted. Perhaps this method can help someone else in the future:
var portal = Portal('https://www.arcgis.com');
var fields = [
'OBJECTID',
'category',
];
var fs = FeatureSetByPortalItem(
portal,
'1234567890123456789012345',
0, // or whatever index the layer is
fields,
False
);
var filterfs = Filter(fs, "category IS NOT NULL");
return GroupBy(
filterfs,
[
'category',
],
[
{
name: 'Category',
expression: '1',
statistic: 'Count',
}
]
);
Limitations I found: Not able to filter by map extent (as there's no geometry)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.