How to Refresh Enum Options in Settings Based on Another Field?

Hi Ayon team !

My question pertains to the add-on settings. I am building a webhook feature that requires a subscribedUsers settings field. It is a multi-select field that displays all available users. I also created an accessGroup field to allow for group selection.

I would like to connect the two fields, such that: if I select the supervisor access group, the subscribedUsers field is updated with the list of users that have this attribute.

I tried tweaking the recursive_enum_resolver() method you provided in the ayon-example-addon repo (ayon-example-addon/server/settings.py at 67c4c2e236143931c74bbcaa241f8a4c2ad9c281 · ynput/ayon-example-addon · GitHub line 44) by injecting dynamic enum generation based on the selected group, but I could not get the settings UI to refresh or rebuild the dependent field.

My use case would require re-evaluating the subscribedUsers enum options whenever accessGroup changes. I am unsure whether the settings schema mechanism allows this kind of dependency, or whether I should instead:
• Precompute all relations server-side and expose a static dictionary {group: [users…]}, or
• Move the logic entirely inside the add-on logic (resolve user lists at runtime instead of in the settings UI).

If you think of any solution I’d gladly take them ! If there is none then I’ll consider a simpler configuration.

Thanks!
Semiha

The code you are referring to is 2 years old.

I’m not sure if this example is still relevant as Dynamic enums were added in AYON Server 1.12.5

Thanks Mustafa !

I’ve spent the day exploring Dynamic enums, and it looks really promising.

I really liked the idea behind the example-addon repository, I wish it was updated with the new features you shipped since it’s a good source of truth for quickly building settings, and helps circumventing the lack of up-to-date documentation.

Thanks again for your help,
Semiha

Personally, I depend on our addons + ayon-backend repos and if there’s a setting or some feature like web actions, I’ll start finding the closest example to my idea and then stealing getting inspired.

It’s called inline documentation which is an additional source of information.