How to show the Record name in the parcels' popup?

1081
6
08-27-2020 03:30 AM
Labels (1)
AmirBar-Maor
Esri Regular Contributor
3 6 1,081

If you want to see the records name of a parcel, line or point in the popup, you can do that by using an Arcade expression.

Here are the steps:

1. Right click on the layer --> Configure Popups

2. Press the Expressions on the bottom

3. press New to add a new expression and give it a name and a title:

4. Add this expression 

var RecordName = First(FeatureSetByRelationshipName($feature, 'RecordHasTax', ['Name'], false));
return RecordName.Name;

5. Modify the name of the relationship class (bolded above)

6. Test by clicking on a feature (you can apply this to a parcel, boundary line, connection line and points)

Let me know if you find this example useful?

6 Comments
AndrewWallick
Occasional Contributor II

Hi Amir,

I'm trying to do something similar, but in a field within the Tax layer. I'd like to get the name of the CreatedByRecord record into one field and the name of the RetiredByRecord record into another.

Is it possible to use a modified version of this script to populate a field using an attribute rule?

AmirBar-Maor
Esri Regular Contributor

@AndrewWallick 

Absolutely!

To populate the name of the record that CREATED the parcel it's exactly the same expression.

For the retired record there are 2 options:

  1. Create a relationship class using the RetiredByRecord field and then use that relationship class in your expression (same expression)
  2. Use a SQL expression and the Arcade command 'Filter' to get the record. Let me know if you would like me to provide you with the expression for this option. Should only take a few minutes to create and test.
AndrewWallick
Occasional Contributor II

Thanks for the quick response! I'm having trouble getting this expression to work though (even on the popup). I'm getting the error "Invalid relationship class name". How do we know where to find the correct relationship class name? I tried "PARCELEDIT.RecordHasTax" because I thought that was the name of the relationship class (see below). I also just tried "RecordHasTax" but that didn't work either.

AndrewWallick_0-1706728220791.png

 

Edit: I realized the problem was I was trying to edit the pop up on the layer in Pro, which was pulling from the feature service. Once I brought in the layer from SDE, I was able to get it to work on the pop up.

I am still having a problem getting it to work in an attribute rule though. I'm pulling it directly from the SDE database, but getting this message when I try to save it: "Error 002717: Invalid Arcade expression, Arcade error: Unexpected null, Script line: 2". Do you know what could be causing this? I copied the script in exactly as you had it (which worked perfectly for the pop up).

 

AmirBar-Maor
Esri Regular Contributor

@AndrewWallick 

Please disregard my last comment. 

I have modified the expression to this:

var Record = First(FeatureSetByRelationshipName($feature, 'RecordHasTax', ['Name'], false));
If (IsEmpty(Record)) {
  return "No Record Found";
}
return Record.Name;

 

It checks to make sure the relationship is not empty.

You can see that the popup and Attribute Pane show the same result:

AmirBarMaor_0-1706773600818.png

 

And if it's empty:

AmirBarMaor_1-1706773665912.png

Let me know if this now works for you

 

 

AndrewWallick
Occasional Contributor II

@AmirBar-MaorThat worked to let me save the attribute rule, but after republishing the parcel fabric and trying to apply an edit, I'm now getting this error:

AndrewWallick_0-1706811507450.png

It sounds like it's not getting the array, I'm guessing from the FeatureSetByrelationshipName function?

AmirBar-Maor
Esri Regular Contributor

@AndrewWallick 

It looks like your script is failing on the first line... It might be a good time to contact technical support to have a look.
For example - maybe the version of your enterprise is too old?!

AmirBarMaor_0-1706864069111.png

Do you use the fully qualified relationship name? for example in this case the relationship class name is 'cadastre.amir.RecordHasTax_4'

AmirBarMaor_1-1706864210899.png

Did you check the 'Exclude from client evaluation' checkbox on your rule?

...

 

 

 

 

About the Author
Product Engineer @ Esri. working on Parcel Fabric and ArcGIS Pro Tasks. Education: M.Sc. Geodetic Engineering, Licensed Land Surveyor, Licensed Real Estate Appraiser, System Designer, Project Manager... Free time: family, sailing, wing foiling, windsurfing, kitesurfing, diving, hiking.