Select to view content in your preferred language

Swap source on hosted feature layer view not updating correctly

1543
10
07-18-2024 08:11 AM
MappyIan
Frequent Contributor

I recently came across a blog post by @RichNauman and @EmilyMeriam1 where they describe the process of using the Swap Source function on Hosted Feature Layer Views to manage updates to Living Atlas data.  This process sounds ideal as it allows us to update data offline and only publish the changes once we've carried out the necessary verification steps.

For one of our projects this seemed the ideal way to manage updates, but we've hit a problem and hunting on this community forum it seems that we're not the only ones to have encountered this issue.  This post and this post are very similar to the issue we've been experiencing.

Our setup is that we have a public-facing hosted feature layer View of point features (cafes).  At the moment this View is connected to hosted feature layer A.  I created a copy of the hosted feature layer, made some updates and published it as hosted feature layer B.  I then used the Swap Source function to connect the public-facing View to layer B.  This worked fine and the updated data is visible in the public facing web map. 

However there are a few problems:

  • on the details page for the View it says that it is still connected to layer A, which is incorrect;
  • on the details page for layer A and layer B, they both list the View in the 'Other Views' section, but this should only be the case for layer B (layer A no longer has any 'other views');
  • I can't delete layer A because it wrongly thinks it is connected to the View (the error message says 'These items have other items dependent on them. They must be deleted together.');
  • I can't swap the source back to layer A because it thinks it is already connected to layer A so layer A isn't displayed in the list of available layers, aaaaargh;
  • the final problem is that it makes it very hard to keep track of what the source of the View actually is, so from a data management perspective this could quickly become very annoying.

I don't hold out much hope given that the other two forum posts linked above have had no replies in the years since they were posted, but does anyone know why this is happening and how to get around it?  Is there any way to force refresh the AGOL interface so that it displays the correct information?  I really don't want to have to re-publish all my layers and rebuild all the various outputs.  Given the Living Atlas team use the Swap Source function it seems odd that it's not reliable.  I don't see how I could have done anything wrong as I'm using a single point dataset of just 18 features.

Any help would be greatly appreciated.

Tags (1)
10 Replies
MappyIan
Frequent Contributor

Hi Jeremy, thanks for sharing that information.  And yes, I was using AGOL (we don't have Enterprise).  I won't fully detail all the issues I encountered with the 'swap source' function as these are listed in the bullet points in the original post above.  But to summarise, whilst the 'swap source' function seemed to work okay, the connections between the View and the two source hosted feature layers ended up being confused making ongoing management very tricky.  The only solution was to delete the View, then recreate it from the updated hosted feature layer then rebuild/repair all the web maps/apps that used the View.  A time-consuming process for something that should have just happened automatically through the 'swap source' function.

As mentioned above, we have set up our workflows not to use the 'swap source' function due to these reliability issues.  When I get some time in the future I will test this again and see if it's more reliable nowadays.  Thanks again for sharing your experiences.