Building a dynamically FeatureSetByName query

973
5
Jump to solution
08-03-2021 11:23 AM
Labels (1)
Jake_S
by
Occasional Contributor II
Hey folks, currently trying to dynamically build a FeatureSetByName query but am getting the notorious 9999999 error in ArcGIS Pro 2.6.6 for even a simple case. Does anyone know if this is possible or if I'm going about it the wrong way?
 
JS_Esri_0-1628014984466.jpeg
var s ="indxltm_region_ltm5000"
var x = FeatureSetByName($datastore, s , ["OBJECTID", "PLAN_NAME"], true)if (Count(x) > 0) {    return first(x).PLAN_NAME
}
0 Kudos
1 Solution

Accepted Solutions
HusseinNasser2
Esri Contributor

FeatureSetByName does not support dynamic class names. The name of the class has to be available during static analysis of the script so we can build out the relations in the catalog. (E.g. if you copy Class A which has an attribute rule that reads from Class B we also copy Class B too) 

 

View solution in original post

5 Replies
JohannesLindner
MVP Frequent Contributor

The expression seems to be OK, it worked for me in a Popup.

So either it doesn't work in an Attribute Rule (which I doubt) or it's not the expression that causes the error.


Have a great day!
Johannes
0 Kudos
JohannesLindner
MVP Frequent Contributor

Well... A few days later, I now need the same thing. Now I tested it in an Attribute Rule, turns out it doesn't work there.

@HusseinNasser2, any tips?


Have a great day!
Johannes
0 Kudos
Jake_S
by
Occasional Contributor II

Johannes, thanks for keeping a pulse on this. We still haven't found a solution either

JS

0 Kudos
HusseinNasser2
Esri Contributor

FeatureSetByName does not support dynamic class names. The name of the class has to be available during static analysis of the script so we can build out the relations in the catalog. (E.g. if you copy Class A which has an attribute rule that reads from Class B we also copy Class B too) 

 

RoderickPerendy
New Contributor III

I don't mean to be disrespectful here but could this get added as an error code? Or maybe it has? I'm running off Pro 3.1 and Enterprise 11.1  I would have been pulling my hair out trying to figure out the source of the 999999 error I got until I saw this thread. Removed my When function and made a cascaded if statement instead and it solved the FeatureSetByName issue using dynamic variable.

0 Kudos