Select to view content in your preferred language

How to add a new field or change ItemID in AGOL with Python (or via AGOL, any solution works really )

490
1
Jump to solution
07-09-2019 09:44 AM
BIGlovo
Emerging Contributor

Hi, 

 

So this should be fairly simple but is not, and is making to maintain my webmap almost impossible to maintain.

 

I have published a layer via CSV and with Python with a set of fields, lets say 5, now the same CSV has an extra field (we have 6 in total now). How I can add this new field wihtout having to redo the whole map, webapp that depend on this layer?

 

I tried to add the new field via AGOL in the Data tab (also to the CSV) as well as using the manager.add_to_definition in Python with always the same result, once I overwrite the layer the new field disappears.

Any options?

  1. How can I change the itemID of a layer so lets say I just swap the layers in my Web App (in Python)
  2. OR, how to add this new field via Python and when overwriting stays?

 

Thanks in advance.

Kelly Gerrow

0 Kudos
1 Solution

Accepted Solutions
BIGlovo
Emerging Contributor

So I found a workaround:

Apparently if you delete both CSV and hosted Feature Layer and then upload the new CSv with the new columns adn you use the same name all your webmaps and apps will identify this new layer as the old one, since they have the same name, and all will work as intended. So the process is:

  1. Delete both CSV and Feature Hosted layer (that is created from teh CSV) in AGOL
  2. Upload the new CSV (with the additional columns) using the same name as the old layer, this is basic, if not wont work.
  3. WebMaps and Apps should work as intended

View solution in original post

0 Kudos
1 Reply
BIGlovo
Emerging Contributor

So I found a workaround:

Apparently if you delete both CSV and hosted Feature Layer and then upload the new CSv with the new columns adn you use the same name all your webmaps and apps will identify this new layer as the old one, since they have the same name, and all will work as intended. So the process is:

  1. Delete both CSV and Feature Hosted layer (that is created from teh CSV) in AGOL
  2. Upload the new CSV (with the additional columns) using the same name as the old layer, this is basic, if not wont work.
  3. WebMaps and Apps should work as intended
0 Kudos