POST
|
Chiming in here, I was working on this issue yesterday. Check out my response to this post here, I shared a snippet of my code in which I update the Item Details to reflect the layer change. Hope it helps.
... View more
Tuesday
|
0
|
0
|
40
|
POST
|
Chiming in here, I was working on this issue yesterday. Check out my response to this post here, I shared a snippet of my code in which I update the Item Details to reflect the layer change. Hope it helps.
... View more
Tuesday
|
1
|
0
|
18
|
POST
|
@DougGreen That's awesome that you say it's fixed....unfortunately, I didn't experience the same behavior when I was working on this yesterday. I wanted to share what I ended up doing, after lots of trial and error, which seemed to work. Below is a snippet from the script for the tool I built. try:
# Add layer definition from JSON file to the service definition
result = fs.manager.add_to_definition(config)
if result.get("success"):
arcpy.AddMessage("Layer successfully added.")
# Update the item metadata with the new layer so it appears in the AGOL UI
item.update(data={"layers": [dict(layer.properties) for layer in fs.layers]})
else:
arcpy.AddWarning(f"Failed to add layer. Response: {result}") I found that I needed to use item.update, specifically using a dictionary structure like that, to properly get the item metadata to update to match the service definition. How did you handle your workflow, in which you say it updated the item details automatically? A potentially important detail, I was working with a hosted feature layer that was published from ArcGIS Pro. I believe the metadata for these is structured slightly differently compared to hosted feature layers created in ArcGIS Online directly. Perhaps that was a factor....
... View more
Tuesday
|
1
|
0
|
29
|
POST
|
Thanks for linking to this post, @Egge-Jan_Pollé ! I was on this path earlier today and ended up writing a simple Python script for an ArcGIS Toolbox, which I shared in a reply to that post. Maybe it'll help someone in the future.
... View more
Friday
|
0
|
0
|
75
|
POST
|
This is a very old post, but as far as I'm concerned, if posts like this still show up in a Google search, then it's still relevant! Thank you @mikaël for getting me on the right track - it's important to do it with the REST API, modifying the JSON through ArcGIS Online Assistant did not fully delete the layer from the service (I found that it removed it from the Item Details page, but when viewing the service definition, the item was still there. I think AGOL Assistant only removes it from part of the JSON) Anyway, I'm writing this post to share a script I wrote to put this functionality into a Python tool that can be run in ArcGIS Pro. I hope it maybe helps someone with this process, especially those who don't have a lot of experience with working with the API. Regarding toolbox setup, add this script and set the Parameters like this, and it should work like a charm. from arcgis.gis import GIS
from arcgis.features import FeatureLayerCollection
import arcpy
# Tool input parameters
item_id = arcpy.GetParameterAsText(0) # String (required)
layer_id = arcpy.GetParameter(1) # Long (required)
def main():
gis = GIS("home") # Uses ArcGIS Pro sign-in session
item = gis.content.get(item_id)
fs = FeatureLayerCollection.fromitem(item)
layer_ids = [lyr.properties.id for lyr in fs.layers]
arcpy.AddMessage(f"Available Layer IDs: {layer_ids}")
if layer_id not in layer_ids:
arcpy.AddWarning(f"Layer ID {layer_id} does not exist in the feature service.")
delete_payload = {
"layers": [
{"id": layer_id}
]
}
try:
result = fs.manager.delete_from_definition(delete_payload)
if result['success']:
arcpy.AddMessage(f"Successfully deleted layer ID {layer_id}.")
except Exception as e:
arcpy.AddError(f"Error: {e}")
if __name__ == "__main__":
main()
... View more
Friday
|
1
|
0
|
16
|
POST
|
Not sure if this was the cause of your issue, but I was running into this and what was happening was that my service still existed in the Recycle Bin of AGOL - I had completely forgotten that deletes in AGOL are "soft deletes" now.
... View more
3 weeks ago
|
1
|
0
|
126
|
POST
|
Writing a follow up here in case the information might help someone else who stumbles on this post like I did. For doing this in code, here is an example of code that worked for me: arcpy.management.SetValueForRangeDomain(
in_workspace=r"PATH TO YOUR DATABASE",
domain_name="DateRange",
min_value="1/1/1900 12:00:00 AM",
max_value="1/1/2100 12:00:00 AM"
) And if you want to do it in the GUI, if the Field Type is "Date" and the Domain Type is "Range Domain", then when you click within the Minimum or Maximum cells, there will be a GUI calendar input where you can select the date.
... View more
04-04-2025
11:29 AM
|
0
|
0
|
118
|
IDEA
|
Just wanted to chime in and voice my support for this, agree with what everyone else has said about needed to be able to change default values. (they're supposed to be a convenience, not a limiter). I'm currently experiencing this limitation in regards to a "Start Date" field, where I would like the default to be today(), but want to leave the option to edit it if needed.
... View more
04-03-2025
09:43 AM
|
0
|
0
|
70
|
POST
|
Honestly I'm not sure at this point, and apologies if I suggested incorrect information before (wow that was a long time ago!) But I did find this article - would this help with what you need to do? https://support.esri.com/en-us/knowledge-base/how-to-copy-symbology-from-a-hosted-feature-layer-and-a-000027205
... View more
09-19-2024
11:31 AM
|
0
|
1
|
2832
|
POST
|
Have you enabled the survey theme within the widget?
... View more
07-30-2024
06:00 PM
|
0
|
1
|
542
|
POST
|
Thank you so much, @Evan_Sepa , I was trying to get this to work for a long time and this finally did the trick!
... View more
05-31-2024
11:33 AM
|
0
|
0
|
1210
|
POST
|
Hello! Unfortunately, no I had to drop this task and didn't have time to pursue it further. 😞
... View more
05-21-2024
07:42 AM
|
0
|
0
|
1142
|
POST
|
Hello! Does this documentation help answer your question? https://doc.arcgis.com/en/survey123/browser/create-surveys/updatesurvey.htm
... View more
03-13-2024
10:46 AM
|
2
|
0
|
913
|
POST
|
@PavlovaVitale In a case like this, it should go in the Calculate column
... View more
02-09-2024
07:24 AM
|
0
|
0
|
1395
|
POST
|
Tl;DR: The main issue is that the category selector (select multiple) gets stuck on "loading" when I try to configure it to have flash, pan, or zoom actions. ---------------------------------------------------------------------- Background/Detail: I am working with a dataset that currently has ~100,000 records. Each record has a value in the "Source" attribute with the state name or the federal data source, and so I want to set up a category selector in my dashboard that allows the users to either select all state data through a "Select All" (which filters out the federal data from the map) or the user can select various states individually and see those features on the map. I want my map to pan/zoom to the features when the user makes a selection. The category filter keeps getting stuck on "loading" and won't accept user interaction. This is what I want it to look like: The category selector is configured to display categories from grouped values, based on this filter to remove the federal datasets: The category selector works IF I only have the Filter action. If I try to add Flash, Pan, or Zoom in addition, it gets stuck on the "loading" state. Any ideas on why this is happening and possible workarounds? Thanks!!
... View more
01-29-2024
09:18 AM
|
2
|
3
|
1172
|
Title | Kudos | Posted |
---|---|---|
1 | Tuesday | |
1 | Tuesday | |
1 | Friday | |
1 | 3 weeks ago | |
1 | 07-19-2021 12:53 PM |
Online Status |
Offline
|
Date Last Visited |
Tuesday
|