|
POST
|
In case you need it, take a look at the address solution, it includes attribute rules
https://arcg.is/PuTWX0
... View more
11-16-2024
08:23 AM
|
0
|
1
|
1343
|
|
POST
|
The address solution has a constraint rule, you could adapt it to find the closets match to the input and fill out value:
// This rule will ensure the full name exist in the Master Road Name table
// It will compare the left and right municipality to the municipality in the Master Road Name table
// If the left and right municipality are different there will need to be a road name for each municipality in the Master Road Name table
// Define the Road Centerline fields
var fullname_field = "fullname";
var munileft_field = "munileft";
var muniright_field = "muniright";
// Define the Master Road Names fields
var masterfullname_field = "fullname";
var mastermuni_field = "municipality";
// If the fullname is blank or null return
If (!HasKey($feature, fullname_field)) return true;
var fullname = $feature[fullname_field];
If (IsEmpty(fullname)) return true;
// Get the left and right side municipalities
var munileft = $feature[munileft_field];
var muniright = $feature[muniright_field];
var municipalities = [munileft, muniright];
// This function will attempt to find partial matches in the master road name table
function findPartialMatches(search_municipalities) {
//Attempt to find partial matches and return in error message
var partialMatches = [];
var fullname_parts = Split(fullname, ' ', -1, true)
var muni_clause = mastermuni_field + " IN @search_municipalities"
if (Includes(search_municipalities, null)) {
muni_clause = "(" + mastermuni_field + " IS NULL OR " + mastermuni_field + " IN @search_municipalities)"
}
for (var i in fullname_parts) {
if (Count(fullname_parts[i]) < 3) continue;
var search_string = "%" + fullname_parts[i] + "%";
var masterRoadNames = Filter(FeatureSetByName($datastore, "MasterRoadName", [masterfullname_field, mastermuni_field], false), muni_clause + " AND " + masterfullname_field + " LIKE @search_string");
for (var road in masterRoadNames) {
var roadname = `${road[masterfullname_field]} (${road[mastermuni_field]})`
if (!Includes(partialMatches, roadname)) {
Push(partialMatches, roadname );
}
}
}
return partialMatches;
}
// Search the master road name table for a row matching the fullname and municipality
var muni_clause = mastermuni_field + " IN @municipalities"
if (Includes(municipalities, null)) {
muni_clause = "(" + mastermuni_field + " IS NULL OR " + mastermuni_field + " IN @municipalities)"
}
var masterRoadNames = Filter(FeatureSetByName($datastore, "MasterRoadName", [masterfullname_field, mastermuni_field], false), muni_clause + " AND " + masterfullname_field + " = @fullname");
// If the left and right side municipality we only need one matching record
// If no matching records are found return an error
if (munileft == muniright) {
if (Count(masterRoadNames) == 0) {
//Attempt to find partial matches and return in error message
var partialMatches = findPartialMatches(municipalities);
if (Count(partialMatches) == 0) return {"errorMessage" : "Match for left and right municipality not found. No partial matches found." };
return {"errorMessage" : "Match for left and right municipality not found. Partial matches: " + Concatenate(partialMatches, ", ")};
}
}
// If left and right side municipality are different, we need one record for each municipality in the table
else {
var leftmatch = null;
var rightmatch = null;
for (var road in masterRoadNames) {
if (road[mastermuni_field] == munileft) leftmatch = `${road[masterfullname_field]} (${road[mastermuni_field]})`;
if (road[mastermuni_field] == muniright) rightmatch = `${road[masterfullname_field]} (${road[mastermuni_field]})`;
}
// If either the left or the right side municipality is not found return an error
if (IsEmpty(leftmatch) || IsEmpty(rightmatch)) {
var error = "Match for left and right municipality not found. "
var search_municipalities = municipalities;
if (IsEmpty(leftmatch) && !IsEmpty(rightmatch)) {
error = "Match for left municipality not found. ";
search_municipalities = [munileft];
}
if (!IsEmpty(leftmatch) && IsEmpty(rightmatch)) {
error = "Match for right municipality not found. ";
search_municipalities = [muniright];
}
var partialMatches = findPartialMatches(search_municipalities);
if (Count(partialMatches) == 0) return {"errorMessage" : error + "No partial matches found." };
return {"errorMessage" : error + "Partial matches: " + Concatenate(partialMatches, ", ")};
}
}
return true;
... View more
11-14-2024
02:45 AM
|
0
|
1
|
1452
|
|
POST
|
The result of FSbyAssociation is a table. You can get the pole GlobalID from that table to query the pole layer to get the pole. Take a look at the function below(from https://github.com/Esri/arcade-expressions/blob/master/attribute-rules/attribute_rule_calculation/UpdateAssociatedFeatures.md)
Please post code as a code sample
function get_associated_feature_ids(feature, association_type) {
// Query to get all the content associations
var associations = FeatureSetByAssociation(feature, association_type);
// If there is no content, exit the function
if (count(associations) == 0) {
return null;
}
// loop over all associated records to get a list of the associated classes and the IDs of the features
var associated_ids = {};
for (var row in associations) {
if (HasKey(associated_ids, row.className) == false) {
associated_ids[row.className] = [];
}
associated_ids[row.className][Count(associated_ids[row.className])] = row.globalId;
}
//return a dict by class name with GlobalIDs of features
return associated_ids;
}
... View more
11-14-2024
02:36 AM
|
0
|
0
|
3925
|
|
POST
|
Yes, you would use "Structure"
“structure” – will return the feature the specified feature is attached to through a structural attachment association
... View more
11-11-2024
01:51 AM
|
0
|
2
|
3973
|
|
POST
|
Added a fix here - https://github.com/Esri/Utility-Data-Management-Support-Tools/tree/3.3.3_preview
... View more
11-08-2024
06:41 AM
|
0
|
0
|
2026
|
|
POST
|
@BrettRosso Can you check the name of the ObjectID field on Long_Peak_District_Water_Lines?
Looking at the code, we are incorrectly assuming all classes have an ObjectID field called ObjectID:
... View more
11-08-2024
06:23 AM
|
0
|
1
|
2028
|
|
POST
|
NextSequenceValue should require a string literal, so you need to make a switch yard that list out every call to NextSequenceValue using a string and not a variable. Once you do this, the export AP and copy/paste and other functions will properly copy/export sequences.
Databases have hundreds of sequences by default, we do not want to blindly copy all of them. So we rely on the requirement that NextSequenceValue uses a string literal.
... View more
11-08-2024
06:18 AM
|
0
|
1
|
1295
|
|
POST
|
If they are in the file, we are sending them to the GDB. If the gdb is failing to add them and not report an error, that is an issue. Any chance we can get the entire AP Workspace?
... View more
11-07-2024
01:51 PM
|
0
|
1
|
1582
|
|
POST
|
In the ap_workspace folder, is there any reported in the GP log? Can you verify the AR is in the xml file in the apworkspace folder?
... View more
11-07-2024
01:36 AM
|
0
|
3
|
1605
|
|
POST
|
You are creating an attribute rule, right? That looks like you are using a form calculation rule, which does not support DML(editing other features)
... View more
10-21-2024
10:49 AM
|
0
|
1
|
4240
|
|
POST
|
Please post code as a code snippet:
Code Comments:
Use $FeatureSet
I think you need to use $FeatureSet, as an attribute rule profile cannot use $layer
var matchingProj = Filter($layer, "Project = '" + currentProj + "' AND Intersection = '" + currentIntx + "'");
to
var matchingProj = Filter($featureSet, "Project = '" + currentProj + "' AND Intersection = '" + currentIntx + "'");
For the sql, best to use the @Variable80 syntax
"Project = '" + currentProj + "' AND Intersection = '" + currentIntx + "'");
"Project = @currentProj AND Intersection = @currentIntx");
I am confused by the Distinct call to get the leg directions and then more filtering of the data. I think this could be simplified.
for (var feat in matchingProj){
if (IsNull(feat.LegDirection)){
continue
}
var sumDenominator = 0;
for (var field in fieldsAndScores) {
if (!IsEmpty(feat[field])) {
sumDenominator += fieldsAndScores[field];
}
}
totalSumDenominator += sumDenominator;
}
What you want to do is get all the OIDs or GlobalID of the features you want to update. You are looping over them, so store them into a list/array.
When done, convert that list into a list of dictionaries, with the globalid and an attributes keyword, with the field you wish to update in it
Since this is an attribute rule, it always fires in the database, so it will work no matter what client does the edits. Some client are not aware of the return edit payload from apply edits(instead of the edit just returning success, it returns the others features that were edited so it can do a refresh). So if the client is not reading the return edits, you just need to refresh to see the other updates.
The return edit statement you want is the Updates:
return {
'edit': [{
'className': 'b_edit_dict',
'updates': [{
'globalID': '{7EBAB596-E9DB-40D8-9756-B2EBED2500B7}',
'attributes': {
'field_name': 22
}
}]
}]
}
... View more
10-21-2024
05:30 AM
|
0
|
3
|
4247
|
|
POST
|
Using an attribute rule, yes you can. You can find all points in a distance and trigger an edit on that feature, so its attribute rule fire or calculate the value and set it on that feature.
You want to look at the return edits keywords:
https://pro.arcgis.com/en/pro-app/latest/help/data/geodatabases/overview/attribute-rule-dictionary-keywords.htm
... View more
10-18-2024
05:50 AM
|
0
|
1
|
4288
|
|
DOC
|
@BrianLendt1 We have not done any additional work on the model. I know a few districts have started with it as a baseline.
... View more
10-16-2024
05:47 AM
|
0
|
0
|
2617
|
|
POST
|
I just created a new one in a FGDB with v6 selected and I do not see Big Int
... View more
09-24-2024
05:52 PM
|
0
|
1
|
1949
|
|
POST
|
Well look at that. I am wrong. That is good to know. I retract my comment.
... View more
09-24-2024
07:39 AM
|
1
|
0
|
1980
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | Wednesday | |
| 2 | 07-07-2026 06:45 AM | |
| 1 | 06-26-2026 09:15 AM | |
| 1 | 06-05-2026 05:01 AM | |
| 1 | 06-02-2026 01:29 PM |
| Online Status |
Offline
|
| Date Last Visited |
yesterday
|