I am using an Arcade script in an Attribute Rule that involves using FeatureSetByAssociation($feature, 'connected')
There are two Junction - Junction connectivity associations related to the feature being passed into the FeatureSetByAssocition function. This is the data returned from this function:
ScratchRecordSet is not the expected className. the feature being passed into the FeatureSetByAssociation function is valid. I am using a mobile geodatabase. Is this expected behavior?
Solved! Go to Solution.
Thanks I saw that. Replied to the case.
Adding a summary.
The fact you are seeing Scratch workspace is just a side effect of using GetFeatureSetInfo. GetFeatureSetInfo returns the meta data about the featureset, not the actual data behind the featureset.
ScratchRecordSet is just the temporary workspace we use to store data after querying the associations table, which as you see you got the full dictionary with default values. So nothing wrong here.
To see the returned association rows and the actual class names, write the following arcade, your class names in mobile gdb should be something like "main.classname, use that in your filter.
then in Pro open Arcgis monitor (CTRL+ALT+M), enable debug mode, and look for "ArcadeConsole", you should see the actual json.
var connectivityAssociations = FeatureSetByAssociation(thefeature, 'connected')
for (var a in connectivityAssociations)
console(text(a))
<Event time="Fri Feb 06 09:53:44.904" type="Debug" task#="1605" thread="745c: Main CIM worker thread" elapsed="0" function="Geodatabase.AttributeRule" code="ArcadeConsole">
Arcade{"geometry":null,"attributes":{"className":"main.ElectricDistributionJunction","globalId":"{F4013AD9-F4F0-4B6F-A212-F353ED90F2B1}","isContentVisible":0,"ObjectID":65,"OID":65,"percentAlong":0,"side":"","terminal":1}}
</Event>
hope that helps
Hi @mward_dlc,
It could be the case because it is a mobile dataset. One thing you can try though is if the same attribute expression will work as a calculation in Field Maps(if hosted). If it works locally in a file geodatabase but not in a mobile geodatabase then it is probably the limitation of mobile gdbs.
I will try it in a file geodatabase, but I want to highlight that Feature Classes and Feature Datasets, including Utility Network are supported in a mobile geodatabase according to this document: Mobile geodatabases—ArcGIS Pro | Documentation
While I am not 100% certain, the data I am working with should fall under those categories.
No that shouldn't be expected, can we have the Arcade script used? (And also the Pro version used)
FeatureSetByAssociation returns a featureset, so you would need to either loop or do a First to get the association row.
Best quick test is to use a Popup and click on one of the junctions that have connectivity associations.
var x = First(FeatureSetByAssociation(($feature), "connected"))
if (x == null)
return "No connected feature"
else
return text(x);
You should get something like this
{"geometry":null,
"attributes":
{"className":"main.ElectricDistributionJunction",
"globalId":"{F4013AD9-F4F0-4B6F-A212-F353ED90F2B1}",
"isContentVisible":0,
"ObjectID":65,
"OID":65,
"percentAlong":0,
"side":"",
"terminal":1}}
Do you want me to open a case, or use another method to share the script with you privately?
Yes you may open a case, if you can include the mobile gdb with the script, and the globalids of the feature reproducing the problem, Pro released used it would be good.
send me the case number privately.
Thanks
The case number is 04106484. Thank you.
Thanks I saw that. Replied to the case.
Adding a summary.
The fact you are seeing Scratch workspace is just a side effect of using GetFeatureSetInfo. GetFeatureSetInfo returns the meta data about the featureset, not the actual data behind the featureset.
ScratchRecordSet is just the temporary workspace we use to store data after querying the associations table, which as you see you got the full dictionary with default values. So nothing wrong here.
To see the returned association rows and the actual class names, write the following arcade, your class names in mobile gdb should be something like "main.classname, use that in your filter.
then in Pro open Arcgis monitor (CTRL+ALT+M), enable debug mode, and look for "ArcadeConsole", you should see the actual json.
var connectivityAssociations = FeatureSetByAssociation(thefeature, 'connected')
for (var a in connectivityAssociations)
console(text(a))
<Event time="Fri Feb 06 09:53:44.904" type="Debug" task#="1605" thread="745c: Main CIM worker thread" elapsed="0" function="Geodatabase.AttributeRule" code="ArcadeConsole">
Arcade{"geometry":null,"attributes":{"className":"main.ElectricDistributionJunction","globalId":"{F4013AD9-F4F0-4B6F-A212-F353ED90F2B1}","isContentVisible":0,"ObjectID":65,"OID":65,"percentAlong":0,"side":"","terminal":1}}
</Event>
hope that helps