Updating Hosted View Join Layer Definition

132
1
04-13-2021 01:58 AM
HamishMorton
Esri Contributor

Hi,

I am setting out to write some code that updates the definition of a hosted view join layer. Essentially I would like it to do the following:

1) Enable schema edits on source layers (have been able to get this working)

 

{
   "hasStaticData" : false,
   "sourceSchemaChangesAllowed" : true
}

 

 

2) I then add fields to the source feature layer(s) which I would like to be reflected in the view layer. I send an updateDefinition POST request in an attempt to add the fields to the view definition and at both the feature service or feature layer level it returns as successful. I get:

 

{
  "success" : true
}

 

however the definition remains the same - the fields are still there. The behaviour is the same when I attempt to remove a field as well.

Does anyone have any ideas on why this might not be working? Or if this is even possible?

Hamish

1 Reply
HamishMorton
Esri Contributor

I have a feeling that this is not possible. Another approach that I am trying to work out is deleting a layer from the view and then recreating it after fields have been added to the source layers. e.g. in the following screenshot I would delete TEST5, add fields to source schema, then recreate TEST5:

HamishMorton_0-1618561365881.png

Interested to hear if anyone has any other ideas!

0 Kudos