Overwrite Hosted Feature Layer - Add New Field

573
3
06-28-2023 01:47 AM
Labels (2)
LiamHarrington-Missin
Occasional Contributor II

Hi,

I have a hosted feature layer that I overwrite from a database export to csv regularly.  It currently has 10 fields.  I want to add an 11th field to the hosted feature service and adjust my csv export to include the 11th field.  The workflow I tried to use is:

1. Manually add, via Data tab, an 11th field to the hosted feature service named "Billable" (String)

2. Update the database export to include the 11th field also named "Billable"

3. Use the "Update Data" - "Overwrite entire feature layer".

My hope was that by adding the field to the hosted feature layer, ensuring the same name, the overwrite functionality would simply overwrite the data and append the additional data for the new field. 

The reality is that after the update, the 11th field that I manually created disappears so that my feature layer goes back to just having 10 fields.  

Before I have to rework the entire creation of the feature layer and remap everything to point at the new feature layer I want to check with you guys as to whether its possible to add a new persistent field that won't dissapear whenever I do an "Update Data" action?

Liam
3 Replies
David_McRitchie
Esri Contributor

Hey Liam,

 

This might be a silly question but is the field deleted after doing this or is it set to hidden?

 

Visuallayers.png

 

David

 

Esri UK -Technical Support Analyst
0 Kudos
LiamHarrington-Missin
Occasional Contributor II

Thanks @David_McRitchie ,

Not a silly question as user error is very possible with me.  However, in this instance it definitely removes the field.  I go into the Overwrite with 11 fields and come out with 10.  

I've provided two sample datasets and checked and the behaviour repeats itself.

Create a hosted feature service (table) with the before file, add an 11th field called Billable and then try and overwrite it with the After CSV.  Assuming you get the same behaviour as me, you'll see your newly created 11th field dissapears.

Liam
0 Kudos
David_McRitchie
Esri Contributor

Hey Liam,

 

I just tested this and got the same behavior. I think it might just be confusing terminology as the overwrite operation should be overwriting the data rows, rather than the Data Schema. I believe this is a technical limit.

I would recommend using Update data in this case, and to remove any duplicated rows if these come up. Once the new Field has been added future Update operations should just add the data.

add&update.png

Hope that helps!

David

Esri UK -Technical Support Analyst
0 Kudos