Adding Data to new Field

1737
4
08-16-2018 09:38 AM
JasonJu
New Contributor

Hi --

I am trying to figure out the easiest way to add data in bulk to a newly added field or column.  Ideally, I'd like to use a .CSV file to upload data in bulk, but if there are other ways outside of manually inputting into the table, please advise.

I know how to add a new field into the existing data, but am having trouble adding data into the new field.  Any suggestions/help would be greatly appreciated!

Tags (3)
0 Kudos
4 Replies
MarisaClaggett
Occasional Contributor II

Hi Jason,

Have you attempted to append the CSV data to the hosted feature layer?  This process can be used to either add new features or update existing features in bulk.

Manage hosted feature layers—ArcGIS Online Help | ArcGIS 

"If the update file contains changes to features already published, you can also use the input file to update existing features. This requires that the layer and the file you use to load updates both contain a field of unique values that ArcGIS Online can use to identify the feature to update. You can define a field in the sublayer of a hosted feature layer as unique from the Data tab of the layer's details page. Then, when you update the layer, ArcGIS Online can use that field as an identifier."

Hope this helps!

Best,

Marisa

JasonJu
New Contributor

Hi Marisa -

I'm still not able to append/update the data.  I'll walk you through the steps I'm taking, please let me know if you know where I am not doing something correctly.

  1. Added initial data and published as feature layer.
  2. I now need to create a new column, so I created a new field called "sample" from the Data tab.
  3. In the .CSV I also create a new column called "sample" with data below it.
  4. I then click "Update Data", and go into "Append Data to Layer".  Now I tried two different ways, both of which I am getting an error.  After uploading the newly updated .CSV with the "sample" column and data:
    1. I un-click "Update existing features" and Continue.  I get an error ("Unable to append data.")
    2. The second way I did it is keep "Update existing features" clicked and I match the FID with the newly created field/column, "sample".  I get the same error (Unable to append data.).

Happy to share some screen shots if that helps, thank you!

0 Kudos
MarisaClaggett
Occasional Contributor II

Make sure that all field types match as well.  Do all fields exist in the CSV as well or only the FID and sample field?

Also take a look at this:

"You must ensure the field values in the update file and the layer correctly and uniquely identify the feature to update. If the values do not, you could lose data when an update overwrites attributes for an existing feature. Update and append will fail if you update results in with nonunique values in a field you have identified as unique."

You can also try just running a join operation in Pro by pulling in the hosted layer, using the FID as the join field and adding the data directly to the service that way.  If none of that works, I would reccomend calling Esri support for assistance. 

Thanks,

Marisa

0 Kudos
KellyGerrow
Esri Frequent Contributor

Hi Jason,

If you add a .csv file with the additional field as a table, you could add the new column of values to the existing hosted feature layer using the join features analysis tool, by matching unique fields. This video outlines this process:

ArcGIS Online Join Features Demo 3 – Join to a table based on common attribute - YouTube 

-Kelly

0 Kudos