Select to view content in your preferred language

Configure Attribute - Attribute Expression

811
3
Jump to solution
03-24-2022 09:11 PM
Labels (3)
Calvin_GIS
Emerging Contributor

HI ESRI Community, 

I am very new to Arcade expression and is seeking for assistance. I am hoping to create something like:

IF $feature A is <= 75000

then $feature B = "Yes" 

IF $feature B is => 75001

then $feature B = "No"

Looking forward the solutions.

Also seeking for doco and video to improve my coding skills. 

Thanks 🙂

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
JohannesLindner
MVP Frequent Contributor
// Calculation Attribute Rule on your feature class
// field: B
// triggers: insert, update

return IIf($feature.A <= 75000, "Yes", "No")  // if condition is true, then "Yes", else "No"

 

The ArcGIS Developer page for Arcade is a good place to start:

Getting Started | ArcGIS Arcade | ArcGIS Developer

I find the function reference especially important, this is a page that I have bookmarked:

Function Reference | ArcGIS Arcade | ArcGIS Developer

If you want to play around, you can do so in the Arcade Playground:

Playground | ArcGIS Arcade | ArcGIS Developer

If you're looking for examples, there is a Github with Arcade expressions for diffferent profiles:

GitHub - Esri/arcade-expressions: ArcGIS Arcade expression templates for all supported profiles in t...


Have a great day!
Johannes

View solution in original post

3 Replies
JohannesLindner
MVP Frequent Contributor
// Calculation Attribute Rule on your feature class
// field: B
// triggers: insert, update

return IIf($feature.A <= 75000, "Yes", "No")  // if condition is true, then "Yes", else "No"

 

The ArcGIS Developer page for Arcade is a good place to start:

Getting Started | ArcGIS Arcade | ArcGIS Developer

I find the function reference especially important, this is a page that I have bookmarked:

Function Reference | ArcGIS Arcade | ArcGIS Developer

If you want to play around, you can do so in the Arcade Playground:

Playground | ArcGIS Arcade | ArcGIS Developer

If you're looking for examples, there is a Github with Arcade expressions for diffferent profiles:

GitHub - Esri/arcade-expressions: ArcGIS Arcade expression templates for all supported profiles in t...


Have a great day!
Johannes
Calvin_GIS
Emerging Contributor

Legend! Thank you so much for your help. Sorry to be a pain but I am just wondering what would the syntax if it's between 1 to 75000? 

0 Kudos
JohannesLindner
MVP Frequent Contributor

Then you use a logical AND to concatenate the conditions (A >= 1 AND A <= 75000)

return IIf($feature.A >= 1 && $feature.A <= 75000, "Yes", "No")

Have a great day!
Johannes