|
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
|
1561
|
|
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
|
1393
|
|
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
|
983
|
|
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
|
799
|
|
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
|
2407
|
|
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
|
2407
|
|
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
|
2407
|
|
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
|
2191
|
|
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
|
2191
|
|
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
|
4085
|
|
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
|
4085
|
|
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
|
4085
|
|
POST
|
Hey Andrew, That error means that FeatureSetByName could not find the table name {FC} Means the table {FC} could not be found. Can you paste your script and a picture of your geodatabase schema? The `$datastore` global in FeatureSetByName must be your geodatabase workspace, so make sure that the table Name you specify is the physical table name in your geodatabase not the layer name. Hope that helps Here is a video of the talk I gave back in Dev Summit 2019 in Attribute rules with demos from scratch Attribute Rules in Arcade Video | Esri
... View more
01-24-2020
07:19 AM
|
1
|
4
|
4085
|
|
POST
|
Hey Juul, Thanks for your feedback. The utility network allows only one session to be validating on DEFAULT at a time. When performing a validate topology on the DEFAULT version the validate operation acquires a lock and starts working, any other validate attempts will fail with the error you outlined above if a validate session already running. At 1:20 scale the validate process should quickly finish, so something isn't right. We would like to know more details, here are few questions 1. What version of ArcGIS Server/Pro are you running? 2. How many features (roughly in the 1:20 scale)? 3. How many dirty areas in the 1:20 scale? 4. How many total error features you have in the utility network (you can find that out in network properties) Meanwhile for a workaround you can simply stop the validate process to release the serialized lock. That can be done by either restarting the feature service or setting a lower usage timeout on arcgis server for that particular feature service (Default is 10 minutes I think) Hope that helps Hussein
... View more
11-15-2019
02:04 PM
|
0
|
2
|
3312
|
|
POST
|
Pro 2.4.2 is now live and should fix this problem. Thanks for reporting this and again apologies for taking this long, the patch is large and has a lot of good performance fixes across the entire system not just utility network. -Hussein
... View more
10-03-2019
10:03 AM
|
0
|
0
|
907
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-02-2025 06:31 AM | |
| 3 | 09-03-2025 12:49 PM | |
| 1 | 08-27-2025 10:23 AM | |
| 2 | 08-12-2025 11:01 AM | |
| 2 | 08-05-2025 09:20 AM |
| Online Status |
Offline
|
| Date Last Visited |
Thursday
|