Select to view content in your preferred language

Expression to update Point attribute with attributes of intersecting polygon

469
2
01-29-2024 11:31 AM
JamesBooth
Occasional Contributor

Hello ESRI Community!

I am still very much a rookie when it comes to Arcade and programming in general really. So I could use some assistance in getting my Attribute Assistant Tool setup ported over to ArcGIS Pro.

Below are some records from my dynamicvalue table that I'm having challenges in translating into a single or multiple attribute rules.

39WASTE_TABLEPU_DAYEXPRESSIONIIF([EXCPT_TYPE]="Landuse" OR [EXCPT_TYPE]="Multi-Residential" OR [EXCPT_TYPE]="New Development" OR [EXCPT_TYPE]="Private","No Pickup",Nothing)TRUETRUEFALSEFALSE6<Null>
32WASTE_TABLEZONEEXPRESSIONLeft([ZONE], 1)TRUETRUEFALSEFALSE5<Null>
33WASTE_TABLEZONEEXPRESSIONIIF([ZONE] = "A","ZoneA", IIF([ZONE] = "B","ZoneB", IIF([ZONE] = "C","ZoneC", IIF([ZONE] = "P","ZoneP", IIF([ZONE] = "S","ZoneS", IIF([ZONE] = "U","ZoneU","<Null>")))))) & " - "TRUETRUEFALSEFALSE4<Null>
34WASTE_TABLEZONEEXPRESSIONIIF(IsNull([EXCPT_TYPE]),[ZONE] & " " & [PU_DAY], IIF([EXCPT_TYPE]<>"BIA",[ZONE] & " Exception - ",[ZONE]))TRUETRUEFALSEFALSE3<Null>
35WASTE_TABLEZONEEXPRESSIONIIF([EXCPT_TYPE]="Pickup",[ZONE] & " " & [PU_DAY],[#]) TRUETRUEFALSEFALSE2<Null>
36WASTE_TABLEZONEEXPRESSIONIIF([EXCPT_TYPE]="Thorah",[ZONE] & " " & [EXCPT_TYPE],[#])TRUETRUEFALSEFALSE1<Null>
37WASTE_TABLEZONEEXPRESSIONIIF([EXCPT_TYPE]="BIA",[ZONE] & " " & [EXCPT_TYPE] & " - " & [PU_DAY],[#])TRUETRUEFALSEFALSE1<Null>
38WASTE_TABLEZONEEXPRESSIONIIF([EXCPT_TYPE]= "Private" OR [EXCPT_TYPE]="New Development" OR [EXCPT_TYPE]="Landuse" OR [EXCPT_TYPE]="Multi-Residential",[ZONE] & " " & [PU_DAY] & " - " & [EXCPT_TYPE],[#])TRUETRUEFALSEFALSE1<Null>

 

I could really use some help in translating these expressions into appropriate Attribute Rule within ArcGIS Pro. Any guidance on how to do this would be greatly appreciated. : )

0 Kudos
2 Replies
MikeMillerGIS
Esri Frequent Contributor

Arcade has iif and decode, but I think using an array and checking to see if the value is included is easier

For example, your one expression

IIF([EXCPT_TYPE]= "Private" OR [EXCPT_TYPE]="New Development" OR [EXCPT_TYPE]="Landuse" OR [EXCPT_TYPE]="Multi-Residential",[ZONE] & " " & [PU_DAY] & " - " & [EXCPT_TYPE],[#])

 

would be converted to this

var valid_values = ["Private", "New Development", "Landuse", "Multi-Residential"];
if (Includes(valid_values,$feature.EXCPT_TYPE)){
  return $feature.ZONE + " " + $feature.PU_DAY + " - " + $feature.EXCPT_TYPE
}
else{
  return $feature.EXCPT_TYPE
}

 

0 Kudos
JamesBooth
Occasional Contributor

Thank you for this. This certainly will help!

0 Kudos