Select to view content in your preferred language

add column via "update data"

84
1
Friday
JanK
by
New Contributor

Dear all,

I am writing because of an issue with layers that are imported from files. If I want to update the layer from a new version of the file that contains a new column that I want to add to the dataset, I don't see any way to do so instead of deleting the whole layer and creating it new by uploading the new version of the file. 

Here are the steps to reproduce the issue:

  • Content > New Item > Feature Layer > Upload a file > upload an xlsx table > "Add locations.xlsx and create a hosted feature layer or table" > next, next, finish, finish
  • Open the feature layer, go to the "Data" tab. You see all columns and all data from the xlsx file.
  • Open the xlsx file locally and add one more column "testcolumn" with some dummy data
  • Go to the "Overview" tab > Update data > From a file > Overwrite entire feature layer > upload the updated excel file
  • Open the feature layer, go to the "Data" tab.

Expected behavior:
You see all columns, including the new "testcolumn" with the dummy data.

Actual behavior:
You see only those columns that existed before, there is no "testcolumn".


I also tried to add a column with the corresponding name in the data tab before overwriting the entire feature layer, but that didn't help. I also tried adding a column with the corresponding name and not overwriting the entire layer but just "updating", also without success.
I can understand that column renames might be hard to handle, but I would a simple addition expect to work.
I am not sure, but I think with csv files instead of Excel it was possible to add columns.

I would be glad to receive a solution for this, because the current workflow forces me to delete the whole feature layer and start from the beginning what makes me loose all layer settings that I applied to the map earlier (colors, icons etc.)

All help is much appreciated, thank you in advance!

0 Kudos
1 Reply
timcneil
Esri Contributor

Hi @JanK , 

When you overwrite the feature layer, we are essentially deleting and recreating the service for you based on the file you upload. Overwrite does not account for schema changes and we don't recommend using it for the workflow you describe above (adding new fields). 

I also tried adding a column with the corresponding name and not overwriting the entire layer but just "updating", also without success.

This would be the workflow I would recommend. But you will need to make sure that the new field (e.g., testcolumn) is added to the existing hosted feature layer (the "destination") AND the uploaded .xslx file (the "source") before using the Update Data workflow.

The workflow should look something like: 

  1. Publish the .xlsx file as a hosted feature layer (this will be the update "destination")
  2. Add the new "testcolumn" field to the destination hosted feature layer via the Data tab.
  3. In the .xlsx file (the update "source") make sure the data for the testcolumn field is present. 
  4. Update data > Update existing features > Upload .xslx file > Match based on the unique ID > In the field matching step the testcolumn field will show and will auto-match to the source if the field name/type matches. 

Here are some other resources that may be helpful: 

Best, 

Taylor