Select to view content in your preferred language

Add Inspection/Related Record: Bring Value from Feature Class to Related Table? Arcade?

3323
14
Jump to solution
05-18-2022 08:27 AM
ArmstKP
Regular Contributor

When clicking the blue add button to add a related record/inspection, it brings the globalid/guid value forward into the related table, but what if I want the feature class park name value to populated the related table as well in the park_name field?

0 Kudos
14 Replies
DougBrowning
MVP Esteemed Contributor

I wonder if you cannot use by relationship name because the New Map viewer has no relationship class support?  Also wonder how poster is using this when the map has no relationships.

thanks

0 Kudos
by Anonymous User
Not applicable

Field Maps uses the relationships defined in the feature service. As long as the parent and child layers are in the map and there is an actual relationship between them, this should just work. There are some existing issues with the Arcade implementation where this doesn't work with offline areas or where the casing of field values matters.

If someone has a sample map where the FeatureSetByRelationshipName isn't working, can you please DM me about it? I'm happy to look into and log an issue if necessary.

by Anonymous User
Not applicable

Just as a follow-up, we've identified two issues related to FeatureSetByRelationshipName.

1. If your relationship contains a "." in it, then the Android and iOS apps fail to successfully execute the expression. This also occurs in Pop-ups. This is under investigation but probably won't make the next release.

2. In the Arcade editor, if the related layer/table does not have any features it, when you attempt to test it or save an expression that used FeatureSetByRelationshipName the editor fails to execute the expression with "Execution Error:Cannot read properties of undefined (reading 'toString')". The reason it fails is due to how the Arcade Editor evaluates the expression when the foreign key field value is null. When Field Maps or Map Viewer launch the Arcade editor, they need to provide a sample feature to represent $feature. It will query to find the first feature in the layer/table and use that. If there are no features, it generates a sample feature using the default values of the field. In this specific case, if your related table has no features in it, this sample feature will likely have a null value for it's foreign key field. A simple workaround is in the Arcade Editor edit $feature using the > icon and then the pencil/edit icon and add any value to the foreign key field (it doesn't matter what). Then you should be able to test and save it. This is not planned to be fixed in the next release.

CodraFrum1
New Contributor II

Thank you Aaron, I simply replaced the FeatureSetByRelationshipName (because it did contain "." to FeatureSetByName

ZachBodenner
MVP Regular Contributor

Is there an update on a fix for the first problem? Since we use referenced geodatabase classes, I think it's basically always going to have a "." in it right? It would be great to see this issue addressed!