Select to view content in your preferred language

Add addtional field to hosted feature service that is part of a joined feature layer view

1865
8
Jump to solution
09-18-2023 08:49 AM
Sven_Harpering
Esri Contributor

Hi,

we got a question from one of our customers. The customers has two hosted services. One table and feature service. The customer used the tool "Join Features" in ArcGIS Online with the option to create a layer view as an result.

The problem is that the customer now wants to add a field to one of the datasets and the "Add Field" button is not available. In our opionion this is correct so far, because there is this known limitation: 

  • You cannot add fields to or delete fields from hosted feature layers that have a dependent joined feature layer view.

Is there any possible way to add a field without deleting the view? The problem is, if the customer deletes the view, he has to configure all applications again.

Best

Sven

Passionate about GIS and on the journey as an instructor for analytical insights.
1 Solution

Accepted Solutions
MobiusSnake
MVP Regular Contributor

Hi Sven, I don't know how to add a field without deleting the view, but I've run into this before and I did the following to mitigate the pain of reconfiguring apps:

  • Take note of the view's Item ID and URL (copy them into a text editor or wherever)
  • Delete the view
  • Add the field
  • Re-create the view
  • Write a script using the Python API that does the following for each web map and app that references the old view:
    • Get the map/app's item and called Item.get_data() to pull down it's JSON definition
    • Do a find/replace on the JSON to replace the old view's URL and Item ID with the new equivalents
    • Call Item.update() to push the modified JSON definition back in place

View solution in original post

8 Replies
MobiusSnake
MVP Regular Contributor

Hi Sven, I don't know how to add a field without deleting the view, but I've run into this before and I did the following to mitigate the pain of reconfiguring apps:

  • Take note of the view's Item ID and URL (copy them into a text editor or wherever)
  • Delete the view
  • Add the field
  • Re-create the view
  • Write a script using the Python API that does the following for each web map and app that references the old view:
    • Get the map/app's item and called Item.get_data() to pull down it's JSON definition
    • Do a find/replace on the JSON to replace the old view's URL and Item ID with the new equivalents
    • Call Item.update() to push the modified JSON definition back in place
JonJones1
Frequent Contributor

Hello there!

I am encountering a very similar problem. In all honesty, your suggestion sounds amazing, but it's currently over my head... :(. Is it possible for you to create a short YouTube video demonstrating the exact process you mentioned? It would be a tremendous help to me, and I'm sure it would benefit many others as well.

0 Kudos
MobiusSnake
MVP Regular Contributor

Hi Jon, I'm not much of one for creating videos but I might be able to put together a blog post or something like that.  It wouldn't be right away though, so I'm not sure how much it'd help you.

0 Kudos
SaraSiskavich
Emerging Contributor

Thanks.  This approach might help some people.  My view is on our Open Data site, and the whole point is to push out data to external users who will ingest the data in their own apps, which are outside of my control.  

0 Kudos
Sven_Harpering
Esri Contributor

@MobiusSnake, thank you for your reply. We will give it a try. In the meantime I haven't found a better way.

 

Passionate about GIS and on the journey as an instructor for analytical insights.
0 Kudos
JonJones1
Frequent Contributor

Hello there!

I am encountering a very similar problem. In all honesty, the suggestion made by another user in this thread sounds amazing, and I would love to try it myself, but currently, it's over my head... :(.

I am curious to know if you managed to make it work, and if so, would you please consider creating a short YouTube video demonstrating the exact process?

It would be a tremendous help to me, and I'm sure it would be beneficial to many others as well.

0 Kudos
SaraSiskavich
Emerging Contributor

Does the new-ish Recycle Bin feature offer an additional solution to this? Like, can you delete the dependent joined hosted feature view and send it to the recycle bin, then do your schema edits, then restore the dependent joined hosted feature view, rather than having to recreate it from scratch with a new item ID? 

0 Kudos
Galen
by
Emerging Contributor

I don't think the Recycle Bin offers a solution to this. The relationship to the "recycled" joined view will be maintained while it still exists in the bin (I think?). That said, after the joined view was permanently deleted, my feature service still won't let me add fields. 

0 Kudos