var s ="indxltm_region_ltm5000" var x = FeatureSetByName($datastore, s , ["OBJECTID", "PLAN_NAME"], true)if (Count(x) > 0) { return first(x).PLAN_NAME }
Solved! Go to Solution.
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)
here is more details explaining why
Why FeatureSetByName doesn't work with variables
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.
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?
Johannes, thanks for keeping a pulse on this. We still haven't found a solution either
JS
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)
here is more details explaining why
Why FeatureSetByName doesn't work with variables
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.