2

Referencing Creating Attribute Rules using ArcPy in ArcGIS Pro

Now I am trying to build an expression. First it does not give me the option to choose the type of syntax in the expression builder GUI. (ie. Arcade, Python or SQL)

enter image description here

Secondly I used this script

var FID = $tSignalPoles.FID;
if(FID == 0001)
  return "SP-" + NextSequenceValue("tSignalPoles")                                                                                                                                                 

But it cannot find feature that I am calling out in the line 1 variable even though that is the correct source name in the database.

enter image description here

2 Answers 2

1
var FID = $tSignalPoles.FID;
if(FID == 0001)
  return "SP-" + NextSequenceValue("tSignalPoles") 

$tSingalPoles.FID; should be changed to $feature.FID;

1
  • The expression is valid, but when I go to create new features, a new FID is not created, the field value remains nulls.
    – cheff_
    Jan 30, 2020 at 13:11
0
if(isempty($feature.FID)) //If the field is empty or has the default value
return concatenate("SP-" + nextsequencevalue("Traffic_SignalPole_ID")); //calculate a 
new id

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.