|
POST
|
I'm not able to edit an existing Dashboard in AGOL. I believe in Portal there is a button to open the Dashboard in edit mode. This button exists for my Experience, but not for the Dashboard. I can still access the edit mode by appending #mode=edit to the Dashboard URL, but that is cumbersome. What am I missing here?
... View more
04-06-2023
12:24 PM
|
0
|
3
|
1921
|
|
IDEA
|
You can disable double-click in the options. The shortcut to finish a sketch is F2.
... View more
04-06-2023
10:43 AM
|
0
|
0
|
803
|
|
POST
|
Yes, you need to do both edits in the same dictionary. To do that, it's best to restructure the expression a little: // get all features belonging to the same basin and sewer extension
var basin_id = $feature.Basin_ID
var ba_query = "Basin_ID = @basin_id"
var extension = $feature.Extension
var se_query = "Extension = @extension"
if($editcontext.editType == "DELETE") {
// exclude this feature if we're deleting it
var ba_gid = $feature.GlobalID
ba_query += " AND GlobalID <> @ba_gid"
var se_gid = $feature.GlobalID
se_query += " AND GlobalID <> @SE_gid"
}
var wastewater_loads = Filter($featureset, ba_query)
var sewer_loads = Filter($featureset, se_query)
// get the total
var ba_total_gallons = Sum(wastewater_loads, "gallons")
var se_total_gallons = Sum(sewer_loads, "gallons")
// construct the edit array
var edit = []
var basin = First(FeaturesetByRelationshipName($feature, "Basins_CAF"))
if(basin != null) {
var basin_edit = {
className: "Basins",
updates: [{
globalID: basin.GlobalID,
attributes: {TGallons: ba_total_gallons}
}]
}
Push(edit, basin_edit)
}
var sewer = First(FeaturesetByRelationshipName($feature, "Sewer_by_CAF"))
if(sewer != null) {
var sewer_edit = {
classname: "Sewer_Extensions",
updates: [{
globalID: sewer.GlobalID,
attributes: {CafCAP: se_total_gallons}
}]
}
Push(edit, sewer_edit)
}
// return the dictionary to edit feature classes
return {edit: edit} Note: You're missing a space before AND in the query in line 12!
... View more
04-05-2023
09:19 AM
|
0
|
1
|
3134
|
|
POST
|
Glad to have helped. Please select an answer as solution so that this question is shown as answered.
... View more
04-05-2023
08:43 AM
|
0
|
0
|
2993
|
|
POST
|
You use the wrong symbol for the template literal. You're using single quotes, but it has to be backticks. var id = NextSequenceValue ("MySeq");
return `ID-${id}`
// or just use this
//return "ID-" + id
... View more
04-04-2023
12:30 AM
|
1
|
2
|
4211
|
|
POST
|
You will have to write the code for loading the featuresets, but you can do the intersection in a loop. var test_featuresets = [
FeaturesetByName($datastore, "line_a", ["*"], false),
FeaturesetByName($datastore, "polygon_b", ["*"], false),
FeaturesetByName($datastore, "polygon_c", ["*"], false),
]
for(var i in test_featuresets) {
var inter = First(Intersects(test_featuresets[i], $feature))
if(inter != null) {
return {"errorMessage": "polygon A features must not be intersected with others."}
}
}
return true Sidenote: Not too sure about that, but I think you have to return a boolean. errorMessage is for Calculation rules. So you probably want to change the return to false and input the error message in the Validation rule window.
... View more
04-04-2023
12:26 AM
|
1
|
0
|
1303
|
|
POST
|
I am trying to use the Append tool The Append tool is not suited for this task. It takes all features from one table and copies them to the second table. That is not what you want to do here. As @DanPatterson suggested, Join Field could work. You can't get it to work because you need to join on a common field. That is "Name" in your case, but you're trying to join on "Mgmt". Another way to do this is with a little python script (untested): # parameters
input_table = "HOA_Boundaries_ExportFeature"
update_table = HOA_Export_Test.csv"
join_field = "Name"
update_fields = ["Mgmt"]
# read the update table into a dict
fields = [join_field] + update_fields
updates = {row[0]: row for row in arcpy.da.SearchCursor(update_table, fields)}
# loop over the input table with an UpdateCursor
with arcpy.da.UpdateCursor(input_table, fields) as cursor:
for row in cursor:
# copy the updated values
try:
cursor.updateRow(updates[row[0])
except KeyError:
# no update found for this join_field, ignore
pass
... View more
04-04-2023
12:18 AM
|
1
|
0
|
3976
|
|
BLOG
|
Josh, this is very helpful stuff, thanks for the excellent writeup! Alas, I have to address my Arcade pet peeve: What about dates, though? If you've read this far and you're still interested, you probably know that Date values tend to break Data Expressions. I honestly doubt that most users know that... I have answered multiple questions about that and I've seen you and others answering even more questions. And while your solution of using TypeOf is nice and concise, it's also mind-boggling that we have to resort to that. Please consider adding your support to this idea that tries to remove that problem: https://community.esri.com/t5/arcgis-online-ideas/arcade-allow-date-values-in-date-fields/idi-p/1204894
... View more
04-03-2023
01:13 PM
|
0
|
0
|
3773
|
|
POST
|
This is easily achievable with Attribute Rules. If your point feature classes are in the same database as the line feature class, and the point id field has the same name in all point fcs, you can use this expression. Be sure to change the names of the point fcs in lines 14-16, the name of the point id field in lines 34 and 39, and the from and to field names in line 44. // Calculation Attribute Rule on the line fc
// field: leave empty!
// triggers: insert, update
// if we're updateing and the geometry didn't change, abort
if($editcontext.editType == "UPDATE") {
var cur_geom = Geometry($feature)
var prev_geom = Geometry($originalfeature)
if(Equals(cur_geom, prev_geom)) { return }
}
// load the point fcs
var point_fcs = [
FeaturesetByName($datastore, "PointFC1"),
FeaturesetByName($datastore, "PointFC2"),
FeaturesetByName($datastore, "PointFC3"),
]
// get the line's start and end point
var start_point = Geometry($feature).paths[0][0]
var end_point = Geometry($feature).paths[-1][-1]
// find the ids of the points intersecting the line's start and end point
var start_id = null
var end_id = null
for(var p in point_fcs) {
// get the points intersecting the line
var intersecting_points = Intersects($feature, point_fcs[p])
// if start_id is still null, try to get the id of the first point intersecting the line's start point
if(start_id == null) {
var candidate = First(Intersects(start_point, intersecting_points))
if(candidate != null) { start_id = candidate.PointID }
}
// if end_id is still null, try to get the id of the first point intersecting the line's end point
if(end_id == null) {
var candidate = First(Intersects(end_point, intersecting_points))
if(candidate != null) { end_id = candidate.PointID }
}
}
return {
result: {attributes: {FromNode: start_id, ToNode: end_id}}
}
... View more
04-03-2023
01:01 PM
|
2
|
2
|
4274
|
|
POST
|
I tried matching what you did for the date field. What we did with the date field is not applicable here. For the date field, we have to decide which one of two fields to update based on the inspection reason. For this problem, you want to copy the value in MaintenanceReason over to parent.MaintenanceActivityStatus. If there is no such value, don't edit the parent field. You can do that with a simple if statement (and remove your update_field part): if($feature.MaintenanceReason != null) {
update.attributes["MaintenanceActivityStatus"] = $feature.MaintenanceReason
} All together: // abort if there is no ParnetGUID
var parent_id = $feature.ParentGUID
if (IsEmpty(parent_id)) { return parent_id }
// get the inspection status
var inspection_status= When(
$feature.InspectionReason == "Condition Rating" && $feature.OtherDrainageRatable == "Yes",
"Inspection Completed",
$feature.InspectionReason == "Condition Rating" && $feature.OtherDrainageRatable != "Yes",
"Inspection attemted",
null // default value, for example when InspectionReason is not "Condition Rating"
)
// get the date field that should be updated
var date_field = When(
$feature.InspectionReason == "Condition Rating", "LastConditionRatingInspectDate",
$feature.InspectionReason == "Maintenance Activity", "LastMaintenanceActivityDate",
null // some other inspection reason
)
// construct the update instructions
var update = {"globalID": parent_id, "attributes": {}}
update.attributes[date_field] = $feature.InspectionDate
update.attributes["ConditionRatingInspectionStatus"] = inspection_status
if($feature.MaintenanceReason != null) {
update.attributes["MaintenanceActivityStatus"] = $feature.MaintenanceReason
}
return {
'edit': [{
'className': 'CTDOT_Planning_OtherDrainage',
'updates': [update]
}]
}
... View more
04-03-2023
12:34 PM
|
0
|
2
|
3008
|
|
POST
|
No, it doesn't. I guess they copied the rule template and forgot to delete the comment.
... View more
03-30-2023
10:29 PM
|
1
|
0
|
1540
|
|
POST
|
To post formatted code: You can massively simplify your rule. It should work with a regular coordinate system. I didn't test it with a custom system, but maybe it works there, too. var geom = Geometry($feature)
var z = IIf($feature.LIFECYCLESTATUS == 1, 1, 0)
return Point({"x": geom.x, "y": geom.y, "z": z, "spatialReference": geom.spatialReference})
... View more
03-30-2023
01:47 PM
|
0
|
1
|
1974
|
|
POST
|
So the things you need to know for this are the logical operators in Arcade. == equal != not equal, <, <=, >, >= less than, less than or equal, greater than, greater than or equal && and || or You can write your logic like this: var rating_status = When(
$feature.InspectionReason == "Condition Rating" && $feature.OtherDrainageRatable == "Yes",
"Inspection Completed",
$feature.InspectionReason == "Condition Rating" && $feature.OtherDrainageRatable != "Yes",
"Inspection attemted",
null // default value, for example when InspectionReason is not "Condition Rating"
) And if we combine that with the rule from your previous question: // abort if there is no ParnetGUID
var parent_id = $feature.ParentGUID
if (IsEmpty(parent_id)) { return parent_id }
// get the inspection status
var inspection_status= When(
$feature.InspectionReason == "Condition Rating" && $feature.OtherDrainageRatable == "Yes",
"Inspection Completed",
$feature.InspectionReason == "Condition Rating" && $feature.OtherDrainageRatable != "Yes",
"Inspection attemted",
null // default value, for example when InspectionReason is not "Condition Rating"
)
// get the date field that should be updated
var date_field = When(
$feature.InspectionReason == "Condition Rating", "LastConditionRatingInspectDate",
$feature.InspectionReason == "Maintenance Activity", "LastMaintenanceActivityDate",
null // some other inspection reason
)
// construct the update instructions
var update = {"globalID": parent_id, "attributes": {}}
update.attributes[date_field] = $feature.InspectionDate
update.attributes["ConditionRatingInspectionStatus"] = inspection_status
return {
'edit': [{
'className': 'CTDOT_Planning_OtherDrainage',
'updates': [update]
}]
}
... View more
03-30-2023
01:25 PM
|
0
|
4
|
3040
|
|
POST
|
Apparantly when you set a DEFAULT value on a field when you share that to AGOL, it automatically populates all the <Null> values with that default value Huh, good to know. Glad you got it working, please mark the correct answer so this question is shown as solved.
... View more
03-30-2023
01:04 PM
|
0
|
0
|
2404
|
|
POST
|
When I close my browser, my cookies are deleted automatically. That means that every time I log into the Community (daily, some days multiple times), I get greeted by this annoying window: This popup opens after a delay. If I wait 30-60 seconds until it appears, then close it, everything is good. If I don't think about it, I start scrolling through the latest posts and open those I want to answer in a background tab. This message will be displayed in all of those tabs. This is a very bad user experience. Either I wait before using the Community, or I have to do extra work. I already told you what I think, even multiple times. You really don't want me to tell you what I think daily. Imagine if I did that. Each day, you would get 1 to 3 surveys from the same user, which would significantly alter the survey results over time. Please stop controlling the survey window with cookies. You could make it a field in your user database. I imagine a boolean "HasSeenSurvey", if false, display it. Or a date field that stores the last date the survey was shown to the user (like you do with the last login date) and display the survey window every six months or so. (I realize that this is only really a problem for users who come here regularly and delete their cookies, so probably not that many. But this is an issue that somehow really grinds my gears every time I log in here, si I thought I'd bring it up...)
... View more
03-29-2023
12:26 AM
|
3
|
2
|
1104
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 01-30-2023 09:57 AM | |
| 1 | 05-18-2023 12:51 AM | |
| 1 | 03-05-2023 12:46 PM | |
| 1 | 12-07-2022 07:01 AM | |
| 1 | 06-21-2022 08:27 AM |
| Online Status |
Offline
|
| Date Last Visited |
02-03-2024
06:14 PM
|