FeatureSetByRelationshipName Arcade function

235
3
3 weeks ago
IhabHassan
Esri Contributor

Hi All,

I hosted the attached sample data on AGOL. I am trying to run the following arcade expression while configuring popup for the "Permits" layer.

var fs = FeatureSetByRelationshipName($feature, 'Permits_RelatedTbl_1', ['*'], false);
return fs;

However, I run into an error while testing the expression.

Execution Error:An error occurred.
 

There is a relationship as defined in the layer

"relationships" : [
    {
      "id" : 0, 
      "name" : "Permits_RelatedTbl_1", 
      "relatedTableId" : 1, 
      "cardinality" : "esriRelCardinalityOneToMany", 
      "role" : "esriRelRoleOrigin", 
      "keyField" : "globalid", 
      "composite" : false
    }
  ]

Any ideas ?

Tags (3)
0 Kudos
3 Replies
DavidPike
MVP Frequent Contributor

I'd guess it's failing to return a featureSet into a popup Solved: How to use the FeatureSetByRelationshipName Arcade... - Esri Community

0 Kudos
IhabHassan
Esri Contributor

it fails while testing the expression

0 Kudos
IhabHassan
Esri Contributor

I am not sure what is wrong with the arcade line or the sample, although it seems pretty straight forward to me, the function needs the relationship class name to retrieve the feature set, and I am providing the relationship name as it is defined in the service JSON description. 
Any reason why this line would fail ? I tried this in both map viewers classis/new.

0 Kudos