FeatureSetByRelationshipName Arcade function

2681
4
05-31-2021 01:23 AM
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 ?

Regards
Ihab
Tags (3)
4 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

Regards
Ihab
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.

Regards
Ihab
PierreloupDucroix
Occasional Contributor II

Hi,

I have a similar issue, where I provide the name of the relationship as found in the service description, and the featuresetbyrelationshipname returns nothing...

Did you find an answer ?