Select to view content in your preferred language

Dashboard use of FeatureSetByPortalItem

2481
12
Jump to solution
02-08-2023 07:28 AM
PSGeo
by
Regular Contributor

Dear all,

I am trying to do a dashboard in AGOL. Using the example 2 of this link:

However, to work I have to do something that I really don't know.

I need to to clean the "name" from unnecessary code, using this:

Trim(Split(DomainName($feature, 'name'), '_')[-1])

However, it does not accept global variables... therefore $feature - does not work. so after some changes

I end up with this:

var fs = FeatureSetByPortalItem(Portal('https://xxxxx.maps.arcgis.com'), 'a73a2a04e8b24aa7a5a514193a3057a0', 0, [Trim(Split( 'name', '_')[-1]),'DELIV_DATE','sqKm'], false);

 

But I have no idea how this can work for the remaining code of that link.

Can someone suggest me some fixing.

cheers

PS

0 Kudos
12 Replies
PSGeo
by
Regular Contributor

Hi,

date is done, thanks!!!

The filter is not. How do I put the :

var fs = Filter(
    FeatureSetByPortalItem(...),
    "local_type = 'some value'"
)

into this?

var fs = FeatureSetByPortalItem(
    Portal('https://xxxxx.maps.arcgis.com'),
    'a73a2a04e8b24aa7a5a514193a3057a0',
    0,

    ['name','DELIV_DATE','sqKm'],
    false
);

 

 

cheers

Pedro

0 Kudos
jcarlson
MVP Esteemed Contributor

You're not putting it into it, you're wrapping the filter around the existing expression.

var fs = Filter(
    FeatureSetByPortalItem(
        Portal('https://xxxxx.maps.arcgis.com'),
        'a73a2a04e8b24aa7a5a514193a3057a0',
        0,
        ['name','DELIV_DATE','sqKm'],
        false
    ),
    "local_type = 'some value'"
);
- Josh Carlson
Kendall County GIS
PSGeo
by
Regular Contributor

Hi still in the same example:

how do I incorporate from the example of the page this: "return GroupBy(fs, ['COUNTY'],   "

I tried this... but error:

return GroupBy (FeatureSet(Text(out_dict)), ['clean_name'])

 

cheers

Pedro

0 Kudos