|
POST
|
Update: I assumed you have identical layers with different data like I did. If they're not the same I wouldn't go anywhere near this. With the caveat being "it's probably faster and easier to do this in pro", I set up a real short notebook to update the symbology of a layer years ago when I had this problem. I will say now that I am catching up the documentation this doesn't seem to be encouraged so your mileage may vary. from arcgis.gis import GIS
gis = GIS("home")
# Template (fill in id)
template_id = ''
# To Update (fill in id)
layer_to_update_id = ''
#Get template item
template_item = gis.content.get(template_id)
# Get layers were updating
template_layers = template_item.layers
#Get item were updating
to_update_item = gis.content.get(layer_to_update_id)
# Which layer gets the symbology?
to_update_layers = to_update_item.layers
# In this example I am just taking the first template layer and updating the first to update layer, which is what [0] is for (just get the first item in each list)
to_update_layers[0].manager.update_definition({"drawingInfo": template_layers[0].properties['drawingInfo']})
# Verify update
sample_display = gis.map('USA')
sample_display.basemap.basemap = 'dark-gray-vector'
sample_display.content.add(to_update_layers[0])
#Verify the symbology has been applied to the layer.
sample_display I can't for the life of me find how you would apply a filter based on the documentation. I kind of figured it would be similar to this or that there would be a new method or property you could update, but I'm coming up short.
... View more
3 weeks ago
|
0
|
0
|
121
|
|
POST
|
Yeah that happens to be right where I landed with this 🙃. If it helps in future, or helps me when I have to do this again in a year and have no idea how to: Get Data from a Feature Layer as JSON Via where query so I only return 1 record Assign value of attributes to object. I have a compose afterwards that "saves it". It's probably unneeded but it finally works so I don't want to touch it. Assign my AGOL attributes to an second object. These keys match the object that has my update(s): Apply to Each: For each of my parsed records i set key and value to a variable. Whichever key/value pairs I receive, update the object. It'll just ignore any AGOL values i haven't parsed. Send my update. Feels goofy I have to make an extra query and set up like a whole separate flow. Programming is easier than this 😅
... View more
08-15-2025
09:04 AM
|
0
|
0
|
278
|
|
POST
|
I'm hopeful this is a me problem as I'm new to this connector. I simply want to update a record in a feature layer without nulling out all of the other values in my layer on update. I don't know exactly which fields in my layer I'll be updating on any given update; it could be 1 field or 6 fields. In the below example, I only want to update the Notes based on an event ID {"EventID":"FE-2363","EntryType":"Update","Notes":"Scheduled Bla Blah. 1200-2100 UTC. Daily through 8/14"} An object stores my update. My object will not have all keys/fields present for an update. Any fields missing from my update I just want to leave as-is. I'm seeing that because I have mapped a non-existent key to a parameter, it is setting it to null and, on send, does exactly what I'm telling it Is there a way to send an update to specific fields without an impossible number of conditionals? If OCR type is not a key in my object, I don't want to send null I want it omitted from the update. But sometimes it will be present. I couldn't find a related post, but if there is I'll happily take a link. Thanks!
... View more
08-14-2025
10:58 AM
|
0
|
2
|
331
|
|
POST
|
Happy to thanks for looking. Should be pretty straightforward: var fieldName = "IWL_NAME";
var features = FeatureSetByPortalItem(Portal("https://faasysops.maps.arcgis.com/"), '8abc49df0f9247b9abd7b62eaa37952d', 0)
var uniqueIds = GroupBy(features, [fieldName], { name: "f_objID", expression: "OBJECTID", statistic: "FIRST" });
var unique_list = [];
for (var id in uniqueIds) {Push(unique_list, id.f_objID)}
var sql = "OBJECTID IN (" + Concatenate(unique_list, ", ") + ")";
return Filter(features, sql); As above the feature set is filtered down to 2 records, which I want to display in the table behind in the screenshot. I figured the table would just load the 2 records in the output, but it loads them all.
... View more
07-15-2025
04:29 AM
|
0
|
2
|
1258
|
|
POST
|
Hi, Any thoughts on what I may be doing wrong/missing? This seemed like it would solve my exact problem (I wanted to show users a table of unique values from a FeatureSet). I took the complete feature set, filtered down to the unique values (2 of 122), and it all looked good: But when I plugged my Arcade data script into a table, I got all records instead of my filtered set:
... View more
07-14-2025
05:29 AM
|
0
|
4
|
1283
|
|
POST
|
Oh I see it now. I had no idea you could do it that way.
... View more
05-06-2025
10:52 AM
|
0
|
0
|
863
|
|
POST
|
As far as I know the spec changed in 1.16 according to the docs and you have to return a dictionary if you use Arcade: Popup Element | ArcGIS Arcade | Esri Developer At least I have to in whatever version I'm running. If i one-liner return 'This is a test', my popup is blank.
... View more
05-06-2025
07:04 AM
|
0
|
2
|
883
|
|
POST
|
Need to adjust your return to be an object I believe: if (firstFeature != null) {
return { type : 'text', text : 'Building is in the zone'}
} else {
return { type : 'text', text : 'Building is not in the zone'}
}
... View more
05-06-2025
05:59 AM
|
0
|
4
|
900
|
|
IDEA
|
It would be fantastic if there were an easier workflow that enabled me/my users to use a drawn sketch(es) as a spatial feature filter(s) so I can filter the display of my features to only those under/outside of/etc the polygon(s). The closest is 'Find by Attributes and Location', but I can't use a sketch layer. I can extract data as a Shapefile via a sketch, but it's a pretty cumbersome workflow for users who are less than savvy.
... View more
04-14-2025
04:30 AM
|
0
|
0
|
435
|
|
POST
|
I assume he's maybe talking about Timestamps displaying in local time vs. UTC as published or something. Take a look here maybe: Time is on Your Side with New Field Types in ArcGIS Online
... View more
04-11-2025
10:51 AM
|
0
|
0
|
594
|
|
POST
|
I think your outfields need to be a list and you may have to clean up your timestamp now = datetime.datetime.now()
lastWeek = (now - datetime.timedelta(days = 7)).strftime("%Y-%m-%d %H:%M:%S")
out_fields = ['LOCID','ACTIVE','ADDRESS','LASTUPDATE']
query_string = f"LASTUPDATE >= TIMESTAMP '{lastWeek}'"
query_result1 = addr_fl.query(where=query_string, out_fields=out_fields)
... View more
04-11-2025
10:41 AM
|
1
|
1
|
559
|
|
POST
|
I think I had a similar / the same question last year and unfortunately the answer seems to be "republish from Pro to update the symbology". Re: Editing a Layer Style/ the drawingInfo in ArcG... - Esri Community
... View more
04-09-2025
04:30 AM
|
0
|
0
|
1094
|
|
POST
|
I meant to get to this today and ran out of time. I didn't get a chance to fully noodle through your script, but below is something where if you click a fire perimeter boundary, it will tell you which Census Tract(s) are under as well as the percent for each (one-to-many). I've tried to use ESRI data so you can make your own map. The expression goes on the current perimeters layer // Boundaries : https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/USA_Census_Tracts/FeatureServer/0
// Fires : https://services9.arcgis.com/RHVPKKiFTONKtxq3/ArcGIS/rest/services/USA_Wildfires_v1/FeatureServer/1
var boundaries = FeatureSetByName($map, "USA Census Tract Boundaries",['*'], true)
var intersections = Intersects(Geometry($feature), boundaries)
var output_text = ''
for(var f in intersections) {
var txt = ''
var percent = ''
var intersection_size = ''
// What is the size of the area that intersects the tract and the fire perimeter
intersection_size = Area(Intersection($feature, f), "acre")
// What % of the fire perimeter is inside the tract?
percent = Text(Round(intersection_size / Area(Geometry(f), "acre") * 100))
// Create an individual line for each
txt = Concatenate(['<p>', f['FIPS'],": is ", percent, "% affected by fire.", '</p>'])
// Output
output_text = output_text + txt
}
Console(output_text)
return {
type : 'text',
text : output_text
}
... View more
04-08-2025
10:57 AM
|
0
|
0
|
669
|
|
POST
|
Came across this looking for something else doing something similar. I don't know if something that says "works on my machine" is helpful but everything seemed to upload for me doing the following: Maybe there's something up with tzlocal() not producing a timezone object?
... View more
03-04-2025
09:22 AM
|
0
|
0
|
670
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 04-11-2025 10:41 AM | |
| 3 | 10-16-2024 07:32 AM | |
| 1 | 01-08-2024 07:28 AM | |
| 1 | 02-05-2024 06:47 AM | |
| 1 | 05-24-2024 07:09 AM |
| Online Status |
Offline
|
| Date Last Visited |
2 weeks ago
|