Newly Added Field Not Available in View Layer

139
1
Jump to solution
01-25-2021 08:40 AM
Labels (1)
jcarlson
MVP Frequent Contributor

I've already figured this one out, but I'm posting my issue and the solution for the benefit of others. Here's the situation:

  1. I have a hosted layer A with fields [1, 2, 3] with a dependent view layer B showing all the same fields.
  2. From Pro, I overwrite layer A, including the new field 4 when doing so.
  3. On layer A, I configure the new field 4 to be visible, have certain domains, etc.
  4. On layer B, when I attempt to update the View Definition, field 4 does not appear in the list of available fields.

I attempted to use the arcgis.features.managers.FeatureLayerManager.add_to_definition() function to an identical JSON dict to the parent layer A, only to get the response that the operation was not supported on view layers.

How then, can I add an new, existing field from A to B?

- Josh Carlson
Kendall County GIS
0 Kudos
1 Solution

Accepted Solutions
jcarlson
MVP Frequent Contributor

The short answer: I can't!

Or I should say, not directly. From what I can tell, view layer B only gets the message that a new field has been added when the add happens in AGOL / Portal.

If I manually add a field 5 to the parent layer A, some background refresh must occur, because then both new fields, 4 and 5, appear on view layer B. Then I can just go and delete field 5 and work with field 4 in the view.

In summary: if you are overwriting a hosted layer, add your new fields first.

- Josh Carlson
Kendall County GIS

View solution in original post

0 Kudos
1 Reply
jcarlson
MVP Frequent Contributor

The short answer: I can't!

Or I should say, not directly. From what I can tell, view layer B only gets the message that a new field has been added when the add happens in AGOL / Portal.

If I manually add a field 5 to the parent layer A, some background refresh must occur, because then both new fields, 4 and 5, appear on view layer B. Then I can just go and delete field 5 and work with field 4 in the view.

In summary: if you are overwriting a hosted layer, add your new fields first.

- Josh Carlson
Kendall County GIS
0 Kudos