Arcade - dangerous - undocumented

579
4
Jump to solution
08-14-2023 09:27 PM
MarkMindlin_idea
New Contributor III

We found a undocumented bug/feature :)))

Although the documentation says that [title] is a "Feature Layer based on its name within a map or feature service"

https://developers.arcgis.com/arcade/function-reference/featureset_functions/#featuresetbyname

 

We tried to use it with a file geodatabase/enterprise and feature class name as a second parameter [title]

ArcGIS Pro 3.1.2

Steps to reproduce:

  1. Create a new project in ArcGIS Pro
  2. Create a new file geodatabase
  3. Create a new polygon feature class, Example name "Transformer"
  4. Create an Immediate Calculation attribute rule for the feature class
  5. The code of the expression
    var fsTransformer = FeatureSetByName($datastore, "Transformer", ["*"], false)
  6. Save the attribute rule
  7. Change the feature class name "Transformer" to another name, Example "Apple"
  8. Save, close and open the project
  9. See the attribute rule - the expression changed to 
    var fsTransformer = FeatureSetByName($datastore, "Apple", ["*"], false)

 

Any comments?

1 Solution

Accepted Solutions
MarkMindlin_idea
New Contributor III

ESRI registered it as a bug

View solution in original post

0 Kudos
4 Replies
GIS_Fox
Occasional Contributor III

I would contact ESRI Tech Support so they could open a bug ticket with the arcade team if you haven't submitted one already. Don't have enough arcade background to know if this is a bug or not and your organization may have settings that differ wildly than others. Without more context it would be wise to seek ESRI's input on their arcade team and go from there. 

Jansen Lyons - Records and GIS Section - Public Works - City of Rio Rancho, NM
Wolf
by Esri Regular Contributor
Esri Regular Contributor

Like @GIS_Fox  i don't have enough Arcade background either, however, i am not sure what exactly the bug is.  That the feature layer name is updated in Arcade after you change the name of the feature layer that seems to me like a desirable 'feature' (no pun intended).  If the system would not make the Arcade updates for you, you would have to manually check each attribute rule and update the feature layer name there.   Also you are saying that this is 'dangerous' in your question title and i don't see why this is dangerous, can you explain?

MarkMindlin_idea
New Contributor III

Hello @Wolf  and thank you for your response.

Please use a correct terminology:

  • What we see on a Context menu&Map - is a feature layer
  • What we have in a database - is a feature class

We tried to test if a feature layer name on a Context menu has linked to an Arcade expression - we had changed feature layer name - it had no impact on the expression.

We are not sure if the source of the issue from an inappropriate use of parameters of the Arcade function, or other reason.

Lets imagine that it works as designed for a feature class in a file geodatabase - then see the definition of the type Text

https://developers.arcgis.com/arcade/guide/types/#text

"A text value is a series of characters wrapped in single or double quotes."

We believe it is a very rare case when, in a programming language, an environment will change a "hard-coded" char, string, or text. It would be interesting to find similar "feature" - if you know any examples - please share.

That is why we describe the issue dangerous - it is a not expected behaviour.
In addition, it seems to be undocumented. If you know any documentation available - please share.

0 Kudos
MarkMindlin_idea
New Contributor III

ESRI registered it as a bug

0 Kudos