Select to view content in your preferred language

Include symbology in Change Style Expression

130
1
02-19-2025 09:05 AM
PTW
by
Regular Contributor

Hello! I wrote a simple script to classify incoming Applications by Fiscal Year. Currently 2023 & 2024 are grouped together. I have data for 2023, 2024 and 2025 however we expect more data for 2026.

The problem: I have selected symbology for the data I have (23/24 = green circle size 20, 2025 = blue circle size 20) however I would like to predefine 2026 = orange circle size 20. Currently someone will need to manually update the symbology after some 2026 data has been added.

Is it possible to establish the attribute's icon, color and size within the Change Style Expression? I included the current script below:

var ApplicationDate = $feature.ApplicationDate // Application Date in Question

var FY23Start = Date(2023,6,1) // July 1st, 2023
var FY24End = Date(2025,5,30) // June 30th, 2025

var FY25Start = Date(2025,6,1) // July 1st, 2025
var FY25End = Date(2026,5,30) // June 30th, 2026
var FY26Start = Date(2026,6,1) // July 1st, 2026
var FY26End = Date(2027,5,30) // June 30th, 2027


If (ApplicationDate >= FY23Start && ApplicationDate <= FY24End) {
    return "Application from FY2023 or FY2024"
} else {
    If (ApplicationDate >= FY25Start && ApplicationDate <= FY25End) {
        return "Application from FY2025"
    } else {
        IF (ApplicationDate >= FY26Start && ApplicationDate <= FY26End) {
            return "Application from FY2026"
        } else {
               return "Application not within specified date range"
                } 
            }
        }

 

0 Kudos
1 Reply
AustinAverill
Frequent Contributor

I don't believe this is possible in the Arcade profile that is in MapViewer. However, you can absolutely accomplish this with the API! The following link shows how to add additional symbology to the definition of the webmap, such that it should render your items as defined well into the future. If you start by examining the current symbology of the layer in the definition, you should just be able to add another however many categories you need into the definition based on that template! 

 

https://developers.arcgis.com/python/latest/guide/advanced-cartography-part1/

0 Kudos