POST
|
I have written an attribute rule in Arcade for a feature layer in ArcGIS Pro. The script validates. However, when I attempt to save the attribute rule, I encounter an error message and the rule fails to save. The error message I receive is as follows: error 999999 something unexpected cause the tool to fail when saving attribute rule.
This script gets the endpoint of the current line featureclass, then determines which point feature layers is connected to the end of the line. Then it grabs a value of the connected point feature and calcs it to the line feature.
I'm reaching out to the community for any insights, advice, or troubleshooting tips to help resolve this issue. If anyone has encountered a similar problem or has suggestions for troubleshooting steps, I'd greatly appreciate your input.
Thanks a lot for your help!
// Define function to find intersecting point function findIntersectingPoint(point, layerName) { var fields = ['unitid']; var layer_fs = FeatureSetByName($datastore, layerName, fields, true); if (IsEmpty(layer_fs)) return null; return First(Intersects(point, layer_fs)); }
// Main logic var result = {}; var attributes = {};
// Get the end point of the line var line_shape = Geometry($feature); var spRef = line_shape['spatialReference']; var end_x = line_shape['paths'][-1][-1].x; var end_y = line_shape['paths'][-1][-1].y; var end_point = Point({x: end_x, y: end_y, spatialReference: spRef});
// Define layers to check var layersToCheck = [ "xyz.xyz.wwNetworkStructure", "xyz.xyz.wwPump", "xyz.xyz.wwSystemValve", "xyz.xyz.wwManhole", "xyz.xyz.wwFitting", "xyz.xyz.wwCleanout" ];
// Flag to track if a connected layer has been found var connectedLayerFound = false;
// Check which layer is connected to the end point of the line for (var i in layersToCheck) { var intx = findIntersectingPoint(end_point, layersToCheck[i]); if (!IsEmpty(intx)) { attributes['UNITID2'] = intx['UNITID']; connectedLayerFound = true; break; } }
// Check if attributes is not empty if (connectedLayerFound) { result = { 'attributes': attributes }; }
//console(result) return result;
... View more
05-03-2024
02:40 PM
|
0
|
2
|
978
|
POST
|
This is exactly what I need. I reached out to you directly to get the details. Thank You!
... View more
12-06-2023
10:31 AM
|
0
|
0
|
533
|
POST
|
All of this sounds good! The updates to the Summary Statistic card, especially the "Delegated Metrics," seem like they'll fit our needs. Count me in! Any idea when this cool functionality will be up and running?
... View more
12-06-2023
10:28 AM
|
0
|
0
|
533
|
POST
|
Hello ArcGIS Hub community, I hope this message finds you well. I've been exploring this forum for solutions, but unfortunately, I haven't come across a definitive answer to my specific query. We would like to show the current count of datasets on our Open Data site, and I've seen suggestions about using the API to retrieve a list of datasets. However, what I'm specifically looking for is a way to programmatically obtain the count of datasets without having to parse through the entire list. It's crucial for us to keep this count updated in real-time to provide an accurate reflection of our Open Data offerings. If any of you have experience or insights into achieving this, I would greatly appreciate your input. Additionally, if there are existing discussions or resources on this topic that I might have missed, please point me in the right direction. Thank you all for your time and assistance.
... View more
12-05-2023
02:15 PM
|
0
|
4
|
661
|
POST
|
I'm still encountering the same issue with the script. The error message "invalid JSON on line 22" keeps appearing, and it seems to be linked to the line var copy_feature = dictionary($feature), just like in the previous scripts. The problem persists when I test the script with both egdb and fgdb. I'm using ArcGIS Pro version 3.1.2. Could this issue be related to my version of ArcGIS Pro or Python? Which version of ArcGIS Pro are you using?
... View more
11-14-2023
06:37 PM
|
0
|
0
|
732
|
POST
|
// Get the global ID of the point feature being inserted
var globalId = $feature.globalid;
// Find the corresponding feature in the BCC_JuneSnapShot feature class
var snapshotFeatureClass = FeatureSetByName($datastore, gisdata.sdeowner.JuneBackup");
var filteredFeatures = Filter(snapshotFeatureClass, "BCCGuid = @globalId");
if (Count(filteredFeatures) != 0) {
return $feature.field;
}
var copy_feature = dictionary($feature);
copy_feature['geometry'] = $feature.geometry
return {
"result": $feature.field,
"edit": [
{
"className" : "JuneBackup",
"adds" : [copy_feature ]
}
]
} I'm working against an enterprise geodatabase- above shows how I reference the data in the script. I have also attached the schema for my layers.
... View more
11-14-2023
02:46 PM
|
0
|
2
|
738
|
POST
|
Thanks for responding. I get the error Invalid expression. Error on Line 12 . Invalid JSON. I tried to troubleshoot and change the script a bit but still get the same error.
... View more
11-14-2023
11:57 AM
|
0
|
4
|
746
|
POST
|
Hello ArcGIS Community, I am currently working on an Arcade script for an Insert trigger, and I'm facing some challenges. Your expertise and guidance would be immensely valuable to help me troubleshoot and refine my script. I look forward to your responses and appreciate your time and support. Thank you! Objective: I am developing a Survey123 app that points to an enterprise layer named `BCCpointclass` within ArcGIS Enterprise, not a hosted layer in AGOL. Each time a new point is created in the survey, I want to use an attribute rule on BCCpointclass to create a duplicate of a newly created point and all its attributes in another enterprise point feature class named `BCC_JuneSnapShot`. Issue: From the script below in the expression builder I get the error. "Invalid expression. Error on line 20. Identifier expected. I put a script together from the example in this 2019. This is my script: // Get the global ID of the point feature being inserted var globalId = $feature.globalid; // Find the corresponding feature in the BCC_JuneSnapShot feature class var snapshotFeatureClass = FeatureSetByName($datastore, "BCC_JuneSnapShot"); var filteredFeatures = FeatureSet( Filter(snapshotFeatureClass, "pointGuid = @globalId") ); // If no matching feature is found, create a new feature var newFeature; if (Count(filteredFeatures) == 0) { // Create a new feature in BCC_JuneSnapShot newFeature = snapshotFeatureClass.createFeature(); // Set the geometry and attributes from BCCpointclass to BCC_JuneSnapShot Set(newFeature, 'geometry', $feature.geometry); for (var field in $feature) { if (field !== 'geometry') { newFeature[field] = $feature[field]; } } // Save the new feature in BCC_JuneSnapShot snapshotFeatureClass.addFeature(newFeature); } else { // If a matching feature exists, exit without making changes return $feature.field; } // Return the value of the field 'Field' without change return $feature.field;
... View more
11-09-2023
06:21 AM
|
0
|
9
|
839
|
POST
|
Hello Esri community, I am trying to create an address locator with suggestions for units, suites, apartments, and so on using the ArcPro "Create Locator" tool with our site address point layer. Unfortunately, I have not been successful in getting these fields to show up in the suggestions despite trying various field mapping combinations. I have also contacted Esri support, but they have not been able to resolve the issue either. I have attached a screenshot of the feature table and the locator parameters. If anyone has had success with creating such a locator or has any suggestions on how to solve this issue, I would greatly appreciate your input. Thank you in advance for your help.
... View more
05-10-2023
09:41 AM
|
0
|
4
|
519
|
POST
|
Using ArcPro 2.9.3, I created a non-spatial query layer from our data lake, and now I want to join the query layer to a polygon featureclass from our egdb, but keep getting an error that the featureclass is a locked table. Is it possible to join a non-spatial query layer to a featureclass? I'm also curious how others are integrating non spatial data from enterprise systems (EAM, Permits, Financial) to GIS.
... View more
10-05-2022
11:49 AM
|
0
|
2
|
432
|
POST
|
I need to build a viewer app with a layer list of 40 + layers. What is the best practice for publishing a web service for a web app that needs 40 or so layers? Should I publish one big map service and add each layer to the web map using the url and the corresponding index number? Or should each layer be published as an individual service? Thanks in advance...
... View more
08-24-2021
03:53 PM
|
0
|
7
|
2536
|
POST
|
In Enterprise, I have added a link to a Survey123 form(web) on the splash page. Once clicked, the survey form opens in a new window where users are asked several questions. Is there a way to close the survey window once the user clicks the submit button? I would like the window to close so the the user is redirected back to the webapp. Thanks ahead for all suggestions...
... View more
07-22-2021
10:58 AM
|
0
|
1
|
605
|
POST
|
Thank you. Now it validates in ArcGIS Pro- I also added a line to check for a valid value before populating the record. Now I will test that it works in the Collector app.
... View more
01-15-2021
07:33 AM
|
0
|
0
|
803
|
POST
|
This script runs successfully when I test in the webmap against the service- see the attached image. However, I get an error once I try to use in attribute rules using ArcPro 2.7.x. I'm new to attribute rules, and will appreciate any help folks on this forum. I have a liftstation featureclass with a related table for repeat inspections using collector. I need a rule that will populated the station name from the liftstation featureclass to a field in the related table. I get the error "Invalid expression Error on line 6 General evaluation error" . It's failing at the line "{ output += related_row.STATIONNAME"} Here's the code used in attribute rules. //get the guid of the table feature being updated var filter_query = "GlobalID = '" + $feature.LStationID +"'" //find the lift station layer //$datastore is the current geodatabase //get the GlobalId and STATIONNAME field var related_fs = FeatureSetByName($datastore, 'gisdmz.SDECB.wwLiftStation',['GlobalID','STATIONNAME']) //get the guid of the table feature being updated var filter_query = "GlobalID = '" + $feature.LStationID +"'" //find the station by filtering on the Guid var related_filter = Filter(related_fs, filter_query) var output = '' for (var related_row in related_filter){ output += related_row.STATIONNAME } return { "result": output }
... View more
01-11-2021
03:45 PM
|
0
|
2
|
836
|
Title | Kudos | Posted |
---|---|---|
1 | 03-18-2015 09:29 AM | |
1 | 12-15-2016 07:13 AM | |
1 | 07-24-2017 01:18 PM | |
2 | 07-14-2015 06:23 AM |
Online Status |
Offline
|
Date Last Visited |
07-02-2024
09:44 PM
|