Select to view content in your preferred language

Update a list widget based on selection from another widget

363
5
08-27-2024 01:41 PM
Labels (2)
MinaNada
Emerging Contributor

Hi everyone,

I'm working on a dashboard for invasive plant management using iNaturalist observations for the National Park Service and was wondering if it's possible to filter iNat observations based on a park a user selects.

Specifically, each park has a unique list of invasive plants they routinely have to deal with. 

I want to configure the dashboard so that when a user selects the park unit (e.g. Yellowstone NP), the iNaturalist observations list is updated to that park's respective list

This unique invasive species list is currently in a csv format, not a feature layer.

Is this feasible in Dashboard using the widgets? If so, what's a possible workflow? Or would I need to create some sort of arcade expression?

So far, I created a selector where a user can choose the park they want. When the selector is clicked, it will pan to the park on the map and the iNaturalist list will be updated. 

This is my 1st time creating a dashboard, so any help here would be greatly appreciated!

 

Best,

Mina

0 Kudos
5 Replies
JenniferAcunto
Esri Regular Contributor

You will need to first publish a hosted feature layer or hosted table of your invasive species data, this dataset will need to also have a column for park name. The values in this column should exactly match the park name values you have in the dataset you are using for your current park name selector. 

Once you have this invasive species dataset published, you can bring it into your dashboard and create a List element with it. 

Then in your category selector, add your invasive species list widget to the filter Action.

Use selectors

Learn.arcgis: Build an interactive dashboard

- Jen
0 Kudos
MinaNada
Emerging Contributor

I don't think I made it explicit, but the csv list I have has no geometry. I uploaded the csv into my AGOL, but I'm unable to add it to my web map nor Dashboard.

I tried to create an arcade expression as an alternative, but I also don't know what is missing here:

//iNaturlist Feature Layer
var iNat = FeatureSetByPortalItem(

    portal,
    '99e3e9ccfaec422db6d4266569aa19d7',
    0,
    [
        'taxon_species_name',
        'modified_on'
    ],
    false
);

var parkBounds = FeatureSetByPortalItem(

    portal,
    'a2848257cf5541338bab9b656440bd0c',
    0,
    [
        'UNIT_CODE'
    ],
    false
);

// Create a dictionary mapping UNIT_CODE to invasive species lists
var invasiveSpeciesDict = {
    "BITH": ["Triadica sebifera", "Salvinia minima", "Salvinia molesta", "Lygodium japonicum", "Albizia julibrissin", "Poncirus trifoliata", "Pinus elliottii", "Ligustrum sinense", "Phyllostachys aurea", "Alternanthera philoxeroides", "Melia azedarach", "Paspalum urvillei"],
    "CANA": ["Schinus terebintifolius", "Casuarina equisetifolia", "Imperata cylindrica", "Leucaena leucocephala", "Agave sisalana", "Lygodium microphyllum", "Heptapleuron actinophylla", "Heptapleuron arboricola", "Ardisia crenata", "Scaevola taccada", "Cocos nucifera", "Thespesia populnea"],
    "CONG": ["Wisteria sinensis", "Ligustrum sinense", "Lygodium japonicum", "Perilla frutescens", "Lespedeza bicolor", "Microstegium vimineum", "Melia azedarach", "Lonicera japonica", "Pueraria montana", "Albizia julibrissin", "Pteridium aquilinum", "Liquidambar styraciflua"]
};

// // Get the UNIT_CODE from the feature
var unitCode = parkBounds["UNIT_CODE"];

// // Get the species name from the feature
var speciesName = iNat["taxon_species_name"];

// Check if the UNIT_CODE exists in the dictionary
if (HasKey(invasiveSpeciesDict, unitCode)) {
    // Get the list of invasive species for the UNIT_CODE
    var speciesList = invasiveSpeciesDict[unitCode];
   
    // Check if the speciesName is in the speciesList
    return IndexOf(speciesList, speciesName) > -1;
} else {
    // If the UNIT_CODE is not in the dictionary, return false
    return false;
}

 

I'm attaching a screenshot of what it looks like now if that helps at all.

 

-Mina

 

0 Kudos
JenniferAcunto
Esri Regular Contributor

Did you publish it or just upload it? If you simply uploaded, go to the Item Details and hit the publish button. For location, select None.

JenniferAcunto_0-1724934074773.png

Once you have a hosted table you can add it to your dashboard.

JenniferAcunto_2-1724934275464.png

 

Then in your dashboard, browse to your hosted table in the Stand-alone layers section.

JenniferAcunto_1-1724934154240.png

 

Publish from CSV

- Jen
0 Kudos
MinaNada
Emerging Contributor

It looks like it wasn't published. I got it working and was able to add it to the dashboard. Appreciate the help on this!

 

-Mina

0 Kudos
MinaNada
Emerging Contributor

Hi @JenniferAcunto -

I wasn't aware AGOL supports hosted tables. I believe is my missing link. Thanks so much for your insight!

-Mina

0 Kudos