Making updates to several identical choice-lists (domains) for hosted feature layers

652
5
Jump to solution
01-19-2022 12:02 PM
Katie_Clark
MVP Regular Contributor

Hello,

I have several hosted feature layers (one for each client, 35 to be exact) that contain a point, line, and polygon layer. Each of these have a choice-list (domain) with ~100 items in it that I need to update, so that's 105 choice-lists that need to be updated.

What is the most efficient way to handle this type of update? 

Thanks in advance for any ideas and/or advice!

Best,

Katherine

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
2 Solutions

Accepted Solutions
ABishop
MVP Regular Contributor

Hello Katherine,

Probably the best way to update these hosted features is to republish them and overwrite the currently hosted features.

Amanda Bishop, GISP

View solution in original post

0 Kudos
Katie_Clark
MVP Regular Contributor

Wanted to provide an update in case anyone else comes across this post...

As I mentioned, completely starting from scratch and creating new feature layers was a possible workaround, but the amount of extra work in regards to data management and how it relates to another application we use would have still been pretty tedious.

What seems to be the best solution for me, given my restrictions, was to edit the JSON directly for the feature layer. (don't know why I didn't think of it before!) What I did was manually edit the choice lists just for one layer using the AGOL GUI. I then went into the JSON code for the layer by going to the REST endpoint for the layer and adding "admin" to the URL between "rest" and "services" (see screenshot).

Katherine_Clark_0-1643642420569.png

I could then copy the section of JSON I needed for the domain values and paste into all the other layers.

An important thing to note (this is the way I was taught to do it anyway) is that if you edit the JSON like this, you need to change the lastEditDate value. Delete the numbers and add empty quotes "" before clicking "Update Layer Definition".

Katherine_Clark_1-1643642650923.png

I'm sure there's probably still some more elegant way to do this, but this solution worked for me so that I could avoid having to publish new layers. 

 

 

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek

View solution in original post

5 Replies
ABishop
MVP Regular Contributor

Hello Katherine,

Probably the best way to update these hosted features is to republish them and overwrite the currently hosted features.

Amanda Bishop, GISP
0 Kudos
Katie_Clark
MVP Regular Contributor

Thanks for the feedback, Amanda! That's definitely a good option.

As far as existing data in the layers that I need to preserve, I would need to export the current layers, create the new ones, overwrite the existing, and then append the old data into the newly updated layers, correct?

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
0 Kudos
ABishop
MVP Regular Contributor

Yes.  It may even be a good idea if you can just create new ones since the domains have changed.

Amanda Bishop, GISP
0 Kudos
Katie_Clark
MVP Regular Contributor

Good point. There will be a little bit of back-end work based on how we have things set up, but still way quicker than manually updating all those lists!

Thanks again 🙂

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek
Katie_Clark
MVP Regular Contributor

Wanted to provide an update in case anyone else comes across this post...

As I mentioned, completely starting from scratch and creating new feature layers was a possible workaround, but the amount of extra work in regards to data management and how it relates to another application we use would have still been pretty tedious.

What seems to be the best solution for me, given my restrictions, was to edit the JSON directly for the feature layer. (don't know why I didn't think of it before!) What I did was manually edit the choice lists just for one layer using the AGOL GUI. I then went into the JSON code for the layer by going to the REST endpoint for the layer and adding "admin" to the URL between "rest" and "services" (see screenshot).

Katherine_Clark_0-1643642420569.png

I could then copy the section of JSON I needed for the domain values and paste into all the other layers.

An important thing to note (this is the way I was taught to do it anyway) is that if you edit the JSON like this, you need to change the lastEditDate value. Delete the numbers and add empty quotes "" before clicking "Update Layer Definition".

Katherine_Clark_1-1643642650923.png

I'm sure there's probably still some more elegant way to do this, but this solution worked for me so that I could avoid having to publish new layers. 

 

 

Best,
Katie


“The goal is not simply to ‘work hard, play hard.’ The goal is to make our work and our play indistinguishable.”
- Simon Sinek