Select to view content in your preferred language

Feature update failing to find and change a record in a table

147
5
3 weeks ago
MikeCyclops
Emerging Contributor

Setting up an attribute rule on Update, with the intent that an edit in this feature class will find and change a row in a table. Think in terms of trying to track when a valve or a circuit in a system is temporarily changed from its normal setting - trying to track ones that have been changed and when they go back to normal. The "change" portion of the process has been implemented successfully in a different rule. This is intended to find a row in the table with the GlobalID from the feature class and a Temp Start Time, but no Temp End Time - the edit will "close out" that record by fill in the Temp End Time.

Errors are coming from line 21 of this screenshot, with the message: "Indexable type expected."

Screenshot 2025-06-26 135154.png

0 Kudos
5 Replies
MikeMillerGIS
Esri Frequent Contributor

Filtered_table is a featureset(think feature class).  You need to call First to get first record or loop over it.

0 Kudos
MikeCyclops
Emerging Contributor

Is that still necessary when there's only one record in the table? The FeatureGID in the table matches the GlobalID from the feature class + the table record with a null date in that field - should be unique. Phrasing it another way, think like the table is tracking a light switch being flipped off (and tracked on TempStartDate in the table) and flipped back on (TempEndDate) - we shouldn't have instances where we come into an unlit room and flip the light switch off again.

Edit: I tried adding another variable. On line 16 above, insert the line "var match_table = first(filtered_table)" . I then changed the global id reference on line 21 to be "match_table.GlobalID". It yielded a different error message: Invalid Function arguments.

0 Kudos
MikeMillerGIS
Esri Frequent Contributor
Yes
0 Kudos
MikeCyclops
Emerging Contributor

I tried adding another variable. On line 16 above, insert the line "var match_table = first(filtered_table)" . I then changed the global id reference on line 21 to be "match_table.GlobalID". It yielded a different error message: Invalid Function arguments.

0 Kudos
MikeMillerGIS
Esri Frequent Contributor

Post your code as a code snippet using JS as formatter.  Will make it easier to provide feedback

0 Kudos