Skip to Main Content
Builder.io Ideas
Categories Visual Editor
Created by Guest
Created on Aug 17, 2022

Union of types in a data model

Assume I have a ‘plan’ which can be either plan 1 or plan 2. Today I have an enum (Plan1, plan2) and then two references to the different plans. This is workable, but does offer the opportunities for an error - someone fills out both plans or fills out one plan and sets the enum to the other plan. It

would be nice to be able to tie the enum to the plan so these errors can’t happen. What I mean by this is if the enum is set to plan1 then only plan1 is displayed when creating the data model instance in /content. Similarly, if the enum is set to plan2 then only plan2 is available to be configured.

  • Attach files