New fields not showing up when updating hosted feature layer view

866
4
04-13-2022 09:24 AM
Labels (2)
QianLei
New Contributor II

Hi, I recently updated a hosted feature layer by adding several new fields. I would like to update the corresponding hosted feature view layer. However, I could not see the newly addedly fields when updating the view. I followed the steps here (https://support.esri.com/en/technical-article/000017596) but just can't find the new fields in Select Field option. 

The 1st snapshot is showing that there are 78 fields in total in hosted feature layer; the 2nd snapshot shows there are only 72 fields when updating view - missing the newly added fields.

Do I miss anything? Any help is appreciated, thanks!

 

QianLei_1-1649866779945.png

QianLei_2-1649866898119.png

 

 

 

4 Replies
jcarlson
MVP Esteemed Contributor

This is a pretty common issue. When you say you "updated" the layer, did you re-publish it from Pro? If so, the view doesn't necessarily see the new fields. You have to add the new fields from AGOL / Portal for the views to see them.

There is a way to add them to the views if you republished the layer from Pro or from a file. Using a tool like the Python API or the AGO Assistant, you can edit the JSON definition of the view to add the missing fields.

- Josh Carlson
Kendall County GIS
0 Kudos
QianLei
New Contributor II

Hi Josh,

Thanks for the reply. I updated the hosted feature layer directly on AGOL. I added the new fields under Data section and then update the layer using "overwrite entire layer" by uploading a zip file for a geodatabase. The new fields showed up in the hosted feature layer, just not in views.

Thanks,

Qian

0 Kudos
jcarlson
MVP Esteemed Contributor

Okay, yes. Republishing from an uploaded file does the same thing. It's the difference between overwriting the main feature service and going into the Data -> Fields screen on AGOL and adding fields there. It's add that adding the fields from the Data tab first and then ovewriting didn't allow you to add those fields to the view, though...

In any case, you may have to edit the view layer JSON or else recreate the views. I prefer to use the update_definition method through the Python API when I have to do this sort of thing.

- Josh Carlson
Kendall County GIS
0 Kudos
QianLei
New Contributor II

Hi Josh,

Thanks for the suggested solution - I will try to use Python API to update the definition for views. I didn't do that initially because it seemed easy and straightforward to update directly on AGOL, which is not in this case obviously. Anyway, thanks and I will update this post if Python API doesn't work neither.

Qian

0 Kudos