|
POST
|
The Attribute Rules documentation says: Attribute rules are complementary to existing rules used in the geodatabase, such as domains and subtypes. For example, domains can be assigned to an attribute field to aid in the data collection process by providing a list of valid values for editors. Additionally, an attribute rule can be used to restrict values for an attribute field that are not part of the domain when performing a field calculation. After rules are added to a dataset, they can be evaluated as edits take place or at a later time. Question: What is involved in setting up an attribute rule to enforce a coded value domain? I.e. prevent non-domain values from being entered, even when tools like the field calculator are used. - Do we need to hardcode the domain values in an IF statement in Arcade? - Or can we reference the domain list in Arcade and use it to dynamically restrict values in a field? Thanks.
... View more
03-09-2022
10:44 AM
|
0
|
3
|
4025
|
|
IDEA
|
Could Esri add a section to the docs that explains how to work with vertices in Arcade? For example, to loop through polyline vertices and read them, do the following: var geo = Geometry($feature); for (var part in geo.paths) { var line_part = geo.paths[part] for (var i in line_part) { To loop through polyline vertices and modify them, do the following: var geo = Dictionary(Text(Geometry($feature)));
var paths = geo['paths'];
for (var path_idx in paths){
for (var vert_idx in paths[path_idx]){ Explanation: Geometries are immutable, so we can't modify them directly. But if we convert them to a dictionary, then we can modify the entries in the dictionary, and then use that dictionary to create a new geometry. As far as I know, there isn't anything in the docs that explains how to work with individual vertices by looping through geometries. Sure, there are samples in the GitHub repo, and they're definitely useful. But it seems like a thorough explanation in the docs would be a big help to people who are learning this stuff from scratch. Related post: Arcade: Get paths array from feature
... View more
03-08-2022
11:08 PM
|
8
|
1
|
1444
|
|
POST
|
For my records, here's where the $originalfeature global variable can be found in the docs: Attribute Rule Calculation Globals Variable Name Type Description $datastore FeatureSetCollection A collection of layers in the same feature service or database as the$featureexecuting the script. $editcontext.editType Text Indicates whether the edit event isINSERT,UPDATE,DELETE, or NA(not applicable). $feature Feature The feature being calculated. $originalFeature Feature The previous state of the feature being calculated. $featureSet FeatureSet A collection of features in the same table as the$featureevaluating the expression. Related: - Identify whether a specific attribute value has changed - Arcade: Editing M-values not treated as change to geometry
... View more
03-08-2022
05:49 PM
|
0
|
0
|
1569
|
|
POST
|
The Arcade developer Attribute Rule Calculation docs say: When the attribute rule is evaluated for a dataset, the return value for the expression is cast to the field type of the output value. It is best practice to handle casting within the script for full control of casting behavior to Number, Date, or Text return types. It sounds like that second sentence is implying that we only need to cast datatypes to the output type when the datatype is Number, Date, or Text. Is that correct? For example, for geometries, would we return Polyline(my_dictionary) -- and then rely on Arcade to automatically cast that polyline to a geometry? Or is the fact that Polyline is a subtype of the Geometry type mean that Polyline is technically already a geometry?
... View more
03-08-2022
05:23 PM
|
0
|
1
|
946
|
|
POST
|
Lol. I posted a similar question just now: Arcade: Alias profile It looks like the Arcade GitHub is empty for Aliases. I was hoping to see an example there.
... View more
03-08-2022
04:55 PM
|
0
|
0
|
1253
|
|
POST
|
The Arcade developer docs mention the "Alias" profile: The alias profile allows the map author to write an expression to evaluate a numeric value and return a text alias representing that value. When the alias is needed, the script will be evaluated. It will be passed the value for which an alias is desired. It is expected that the script returns a text value, comprising the alias to be shown. Globals Variable Name Type Description $value Number The numeric value for which a text alias is desired. Return types Text It's not clear to me when/why the Alias profile would be used. What would be an example use case for Alias? Edit: This post is a duplicate of: What/where is the Alias profile for Arcade?
... View more
03-08-2022
04:50 PM
|
0
|
0
|
748
|
|
IDEA
|
Regarding the Arcade developer documentation: I find the description of the Polyline paths array to be confusing: "A three-dimensional array of numbers. The inner-most array contains the x,y,z,m coordinates of a single point. The second dimension contains additional points making up a line segment. The third dimension allows the polyline to have multiple segments." Could that blurb be re-worded so that it's more intuitive? Something like this? - An outer array to hold the multi-parts: [multiple parts here] - A middle array of one or more multi-parts: [multiple parts: [p0], [p1] ] - An inner array that is the sets of vertices: [multiple parts: [p0: [X,Y], [X,Y], [X,Y] ], [p:1 [X,Y], [X,Y] ] ] I think a more intuitive explanation would be helpful. I've heard from a few different people that said they also found the existing wording confusing. Related info here: https://community.esri.com/t5/arcgis-pro-questions/arcade-what-does-quot-zero-dimensional-geometry/m-p/1151925/highlight/true#M52550
... View more
03-08-2022
02:22 PM
|
0
|
1
|
1553
|
|
POST
|
Thanks. And I suppose the dimensions of the geometry are not to be confused with the dimensions of an array? Polyline A polyline is a one-dimensional geometry. This may be created by passing JSON in the format described below to the Polyline() function or by passing a polyline feature to the Geometry() function. Property Type Description type text Indicates the geometry type. This value is always polyline. paths number[][][] A three-dimensional array of numbers. The inner-most array contains the x,y,z,m coordinates of a single point. The second dimension contains additional points making up a line segment. The third dimension allows the polyline to have multiple segments. I find the description of the paths array confusing. I wonder if an explanation like this would be better (although, it is similar to Esri's explanation): - An outer array to hold the multi-parts. [multiple parts here] - A middle array of one or more multi-parts.[multiple parts: [p0] [p1] ] - An inner array that is the sets of vertices: [multiple parts: [p0: [X,Y], [X,Y], [X,Y] ] [p:1 [X,Y], [X,Y] ] ] That explanation seems more intuitive to me. Related: Idea - Improve Arcade polyline paths array documentation
... View more
03-08-2022
01:40 PM
|
0
|
1
|
5058
|
|
IDEA
|
(edited) The SDE.GDB_ITEMS_VW view in Oracle GDBs is relatively slow due to the calculated columns: - sde.sdexmltotext(d1.xml_doc) AS definition, - sde.sdexmltotext(d2.xml_doc) AS documentation, - sde.sdexmltotext(d3.xml_doc) AS iteminfo, Could Esri consider precomputing the calculated columns in that view — especially the DEFINITION field? I imagine there would be a few different ways it could be done: - Materialized view - Function-based index - Trigger to populate a field in a table - Other Oracle mechanisms? We'd do it ourselves in our GDB, but we prefer not to modify the objects in the SDE owner...for multiple reasons, such as: it adds complexity to GDB upgrades. I would think the materialized view option would be especially appealing to Esri. It would be fairly easy to convert the existing view to a materialized view. And the change wouldn't compromise any existing dependencies, since the view's name would stay the same. Esri could use the fast refresh/materialized view logs option...which would mean the materialized view would update in real time (which I imagine is necessary). Similarly, function-based indexes would be a low-impact, easy, real-time option too.
... View more
03-08-2022
12:11 PM
|
4
|
0
|
809
|
|
POST
|
From the Arcade developer docs: Type System - Point: A point is a zero-dimensional geometry. What is meant by "zero-dimensional geometry"? If anything, I would have thought that X, Y, Z would be the dimensions of geometry. How can there be zero dimensions?
... View more
03-08-2022
12:40 AM
|
0
|
7
|
5125
|
|
POST
|
Is there a way to use a related database view in Arcade? (for a calculation attribute rule in the parent FC) If so, are there any requirements, such as registering the view with the geodatabase? Thanks.
... View more
03-07-2022
09:54 PM
|
0
|
1
|
694
|
|
POST
|
Thanks for your help Mike and Kim. Your replies helped a lot. As Mike said: var parent_class = FeatureSetByName($datastore, "Facilities", ["globalid"], false); FeatureSetByName FeatureSet Global Variable: $datastore Idea: Arcade Documentation: Arcade FeatureSets / related FCs And this will probably be useful: $editcontext.editType Text Indicates whether the edit event is INSERT, UPDATE, DELETE, or NA (not applicable). Identify the editing event trigger such as insert, update, or delete
... View more
03-07-2022
09:41 PM
|
0
|
0
|
1624
|
|
POST
|
Thanks! I submitted an idea about improving the docs here: Arcade Documentation: Joined Tables
... View more
03-07-2022
08:36 AM
|
0
|
0
|
1674
|
|
IDEA
|
Could Esri consider improving the Arcade developer documentation on joined tables? How do I reference data from a joined table? You can reference attribute data from a joined table using the square bracket syntax for referencing field names: $feature["joinKey.fieldName"]. // data from a joined table
var demVotes2016 = $feature["COUNTY_ID.VOTED_DEM_2016"];
var demVotes2012 = $feature["COUNTY_ID.VOTED_DEM_2012"];
// returns % change in votes from 2012 to 2016
Round( ( ( demVotes2016 - demVotes2012 ) / demVotes2012 ) * 100, 2); That blurb seems misleading. More info here: Arcade joined tables: joinKey Thanks.
... View more
03-07-2022
08:35 AM
|
0
|
1
|
1259
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-30-2026 11:08 AM | |
| 1 | 05-11-2026 11:23 AM | |
| 2 | 05-07-2026 04:19 AM | |
| 1 | 05-06-2026 09:03 AM | |
| 1 | 03-19-2026 09:29 AM |