Select to view content in your preferred language

Seeking a Tech Wizard: Can You Craft a Short Video Tutorial on Mastering a Specific Task with Python API?

743
4
01-05-2024 08:28 AM
JonJones1
Frequent Contributor

Hello everyone,

I recently came across a discussion where a user encountered a challenge in ArcGIS Online that I believe many of us might face. The user had two hosted feature layers and used the "Joined View Layers" tool in ArcGIS Online to create a hosted feature layer joined view. However, they ran into an issue when they wanted to add a new field to one of the datasets and discovered that the "Add Field" button was unavailable. This is a known limitation, as adding fields to hosted feature layers with a dependent joined feature layer view is not directly possible.

A helpful solution was suggested, but it's quite technical, and I'm struggling to fully understand it. Therefore, I'm reaching out to see if anyone could create a short video tutorial demonstrating this process. This video would be immensely helpful to me and others who might encounter a similar issue.

Here's a summary of the proposed solution for updating the hosted feature layer joined view:

  1. Note the Item ID and URL of the view.
  2. Delete the view.
  3. Add the field to the source feature layer as desired.
  4. Recreate the joined view.
  5. Use the Python API to update each web map and app that referenced the old view, replacing the old view's URL and Item ID with the new equivalents in their JSON definitions.

This solution appears to be an efficient workaround to the problem of adding a field without needing to reconfigure all applications after deleting the view.

My request, or rather my plea, is for someone to create a short YouTube video demonstrating this for many of us who are more visually inclined or less familiar with Python scripting.

Thank you in advance to anyone who can assist with this!

0 Kudos
4 Replies
JonJones1
Frequent Contributor

Any love for this post? Would save me a few hours a week worth of work. 

0 Kudos
AnnWang
Esri Contributor

Hi Jon - This is Ann Wang from ArcGIS Online team.

To access the item:

gis.content.get(item_id) 

To replace the old view with the new one for your web map:

web_map_obj.remove_layer(your_old_layer)
web_map_obj.add_layer(your_new_layer)
web_map_obj.update()

For more information about using and updating GIS content, this blog might be a little helpful for you: https://developers.arcgis.com/python/samples/using-and-updating-GIS-content/

Please let me know if you have any other questions!

0 Kudos
JonJones1
Frequent Contributor

Hi Ann, thank you so much! Could someone possibly create a video tutorial that covers the entire process, from the very beginning at the user's desktop screen, right through to the completion of the update?

If the video doesn't have a lot of commentary, having some explanation would be incredibly helpful, but not at all expected :). 

Please consider that I'm quite new to these more "advanced" tasks and could really use some detailed guidance. I'm sure I'm not the only one finding this issue challenging and any assistance would be greatly appreciated.

 
 
 
 
0 Kudos
kawakawa4
Regular Contributor

Hi Jon, did you ever get more detailed instructions on how to do this?

0 Kudos