|
BLOG
|
Welcome and thanks for joining the Attribute Rules Place on GeoNet – Let's get started! This is a dedicated GeoNet place for attribute rules. As you explore the group, you'll find tools to connect and collaborate. We encourage you to use the community space to ask/answer questions, share and collaborate on attribute rule scripts, and participate in discussions based on your experiences working with attribute rules. The place will be home to general FAQs, Arcade scripts, real world examples and use cases of using attribute rules, blog posts, videos and much more. To get started we invite you to review the group features on the overview page and familiarize yourself with the featured content, resources, related GeoNet places on the right column. Under resources you will find: Pro Help: Attribute Rules - ArcGIS Pro help documentation on attribute rules. Arcade Help - Arcade help documentation. Find references on Arcade profiles, global variables, and functions. ArcGIS Blogs: Attribute Rules - All ArcGIS blogs related to attribute rules. ArcGIS Blogs: Arcade - All ArcGIS blogs related to Arcade. Arcade expressions: Esri github repository - A github repository of ways to use Arcade with specific sections on calculation, constraint and validation rule examples. Arcade Playground - An online console to test Arcade script expressions. We’re excited to connect and collaborate with you and we look forward to seeing your contributions. - The Geodatabase Team
... View more
08-11-2020
07:59 AM
|
9
|
10
|
4628
|
|
POST
|
See how network rules, attribute rules, and arcade can be used to maintain data integrity and obtain insight into your network.
... View more
07-21-2020
11:55 AM
|
1
|
0
|
2210
|
|
POST
|
This demo theater session will demonstrate the user experience for adding, viewing, and executing calculation, constraint, and validation rules in Arcade. All from scratch.
... View more
07-21-2020
11:53 AM
|
1
|
1
|
2791
|
|
POST
|
An introduction to using attribute rules in enterprise geodatabases. We explain what attribute rules are used for, their different types, how they are authored using Arcade, and the execution models on both the client and server. We will also discuss how attribute rules can generate errors that can be inspected and fixed through the ArcGIS Pro user experience.
... View more
07-21-2020
11:52 AM
|
2
|
0
|
1603
|
|
POST
|
Learn some tips to optimize slow arcade expressions with the Geodatabase team. For more information about attribute rules, please visit: http://ow.ly/GjNY50ABgFk
... View more
07-21-2020
11:38 AM
|
1
|
1
|
1459
|
|
POST
|
Hello! Hope I can help, the reason the value is getting set to 0 is because you haven't provided a result in the return payload. thus the default will be used.. If you want to preserve the field value you input just simply return it back as follows.. var fsTargetTable = First(FeatureSetByName($datastore, "Totals", ["globalid","gloves_xs"], false));
var glovecount = $feature.gloves_xs;
var totalglovecount = fsTargetTable.gloves_xs;
totalglovecount += glovecount;
var AddList = [];
AddList[0] = {
'globalid':fsTargetTable.globalid,
'attributes':{
'gloves_xs':totalglovecount
}
};
return {
'result': $feature.yoursourcefieldname,
'edit': [{
'className': 'Totals',
'updates': AddList
}]
}
... View more
06-19-2020
10:33 AM
|
3
|
1
|
1035
|
|
POST
|
No they will not work in Collector in offline mode, that is because when we download the data offline the Attribute Rules are not coming back with the data. They will only work on online mode and will be triggered on the server side. In the future releases we will have the capability for Collector and other ArcGIS Runtime applications to download Attribute Rules and execute them locally offline. It is a big project that is in the works
... View more
01-30-2020
10:18 AM
|
1
|
0
|
850
|
|
POST
|
Apologies I should have mentioned that and Thanks Xander Bakker for reminding me. Yes Validation and Batch Calculation rule are only supported Enterprise Geodatabase Datasets registered with branched versioned. We are bringing the support of File Geodatabase to these type of rules in the upcoming releases soon.
... View more
01-30-2020
07:58 AM
|
1
|
3
|
2559
|
|
POST
|
Thanks Xander! The Attachments arcade function is actually supported on the Attribute Rules profile, we will just need to update the documentation to reflect that. Good find! So yes one can prevent a feature from being created/updated if no attachments was found. However I see this rule fits more as Validation rule instead of a constraint rule (Generating errors for existing features with no attachments)
... View more
01-28-2020
08:49 AM
|
1
|
6
|
2559
|
|
POST
|
Attribute rule is one way to enforce this. You should be able to add a constraint rule to the attachments table of your class that prevents adding a row to the attachment table if the extension is not jpg. You could then publish the class as a feature service to ArcGIS Enterprise and consume it from collector. (Attribute rules not supported on ArcGIS Online yet) Here is an example Here is an example script //if the extension is jpg allow the edit, else don't allow the edit.
if (right($feature.ATT_NAME, 3) == "jpg") return true
return false The attachment will only be added if the file has a `jpg` extension. There might be a bug where you won't get a meaningful error message back today. We might be able to get to that in the future where the actual error message comes back.
... View more
01-27-2020
12:16 PM
|
1
|
11
|
2559
|
|
POST
|
The attribute rules above Are added to a field on the pointClass called "Field" it is just returning the same value indicating a no-op operation (don't do anything) In your case you can just return the sample Id ($feature.sampleid) and assign the attribute rule.. Your rule is complaining about the table that doesn't exist.. make sure that table Section3.DBO.PlannedSoilsSamplngLocationBuffers exists
... View more
01-27-2020
09:38 AM
|
0
|
2
|
2281
|
|
POST
|
Aha this is a little bit tricky. I will attempt to write the basic version of this but there are so many edge cases that this script doesn't solve. (Moving feature, deleting a bunch of features at once) .. But this is just a start.. Two classes polygonClass pointClass On the pointClass add an attribute rule on insert //on insert
//check if we are intersecting a polygon. If yes, set the hasPoint field on the polygon to Yes
var fsPolygon = FeatureSetByName($datastore, "polygonClass", ["globalId"], false);
var intersectedPolygons = Intersects (fsPolygon, $feature);
var polygonFeature = null;
for (polygonFeature in intersectedPolygons) break;
if (polygonFeature == null) return $feature.field; // no polygon intersected found , quit..
//we found a polygon feature set its HasPoint to Yes
return {
"result": $feature.field,
"edit": [
{
"className" : "polygonClass",
"updates": [
{
"globalId": polygonFeature.globalId,
"attributes": {"hasPoint": "yes" }
}
]
}
]
} On the pointClass add another attribute rule on Delete //on delete
//check if we are intersecting a polygon. If yes, make sure we are the last point, if yes set hasPoint to No!
var fsPolygon = FeatureSetByName($datastore, "polygonClass", ["globalId"], true);
var intersectedPolygons = Intersects (fsPolygon, $feature);
var polygonFeature = null;
for (polygonFeature in intersectedPolygons) break;
if (polygonFeature == null) return $feature.field; // no polygon intersected found , quit..
//query the pointClass
var pointGlobalId = $feature.globalid;
var fsPoint = FeatureSetByName($datastore, "pointClass", ["globalId"], false);
var intersectedPoints = Filter(Intersects (fsPoint, Geometry(polygonFeature)), "globalId <> @pointGlobalId"); // find all points that are not me in the polygon
//there are still few points, quit!
if (Count(intersectedPoints) > 0) return $feature.field
//$feature was the last point, .. set hasPoint to No
//we found a polygon feature set its HasPoint to Yes
return {
"result": $feature.field,
"edit": [
{
"className" : "polygonClass",
"updates": [
{
"globalId": polygonFeature.globalId,
"attributes": {"hasPoint": "no" }
}
]
}
]
}
... View more
01-27-2020
07:46 AM
|
2
|
5
|
2281
|
|
POST
|
The correct way of implementing this is little bit more complicated. The easier way can be by having one rule on the polygon class that activates on insert/update and does the query and populate the field. but the problem with this approach is if you move the points then the polygon fields are no longer consistent, you will have to go and make a bogus edit to the polygon to activate the attribute rule. assume you have the following schema polygonClass (fields: hasPoint) pointClass1 //rough script on the polygon class to the hasPoint field
var fsPointClass1 = FeatureSetByName($datastore, "PointClass1", ["objectid"], false);
if (Count(Intersects(fsPointClass1, $feature)) > 0)
return "yes"
else
return "no"
... View more
01-24-2020
01:01 PM
|
1
|
9
|
4261
|
|
POST
|
Assume you have a user called "gdb" and you connected to the workspace with "gdb" user , you can create the attribute rule using FeatureSetbyName ( "gdb.dbo.TreeTable" ). You can also just say FeatureSetbyName ( "TreeTable") (you can do that because gdb owns the table). Regardless what you write we will ALWAYS persist it internally fully qualified "gdb.dbo.TreeTable" If a user "test" try to connect to the workspace and tried to execute the attribute rule (made an edit) then it will query the table "gdb.dbo.TreeTable" which means test must have access to the table "gdb.dbo.TreeTable"
... View more
01-24-2020
10:55 AM
|
0
|
0
|
4261
|
|
POST
|
Hey Andrew, Yes you only add the "gdb.DBO." prefix if you are not the owner of the dataset. if you owner the dataset you can just use the name of the class. Attribute rules are considered schema change so all connections should be closed before a change can be done.. this includes stopping services. (Exclusive lock required) You can add them to any dataset with any registration type versioned or unversioned.
... View more
01-24-2020
10:05 AM
|
1
|
2
|
4261
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 11-03-2025 12:32 PM | |
| 1 | 01-02-2025 06:31 AM | |
| 4 | 09-03-2025 12:49 PM | |
| 1 | 08-27-2025 10:23 AM | |
| 2 | 08-12-2025 11:01 AM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|