How to update an enum?

1
Hi, In my application, I am using one enum having some values. That values consists of Other as a value. When it is selected from the drop down, I am showing another input field to enter user choice manually and storing in another string variable. Now, where ever I use the enum as search filed, I want to show the all enum values along with the Other values entered by the user manually. e.g., My Enum has 6 values. Say 1, 2, 3, 4, 5 and Other. Now when I select the Other from the drop down, I am entering the value 8 manually. Now when I use my enum in search filed, I want to show the values 1, 2, 3, 4, 5 and 8 in that drop down. Can anyone please help me.... Thanks, Venkat
asked
2 answers
0

Venkat, I had a few moments and created a sample project demonstrating this functionality for you to look at. As Jordy says, you'll want to use objects and references here instead of enums.

My sample project can be downloaded here.

Let us know if you have any questions.

answered
4

I don't think what you're trying to accomplish is possible with the use of enumerations because the values of an enum are pre-defined in your model.

You can, however, work with associated objects which you can use the same way as a regular enumeration with a reference selector. In order to make this work you have to create a entity, with a value/label attribute, which acts as a option. The label is the value which you see in your drop down. You also have to connect the entity to the object which you want to show in your page.

Say you have a page with Object A. With a reference selector you can now show other objects (Object B) in a drop down; these are your options.

When you select the option 'other' you can configure a on-change microflow to add another type B object (an option) to your database, you can now configure the label of this option runtime and make it available as option for future uses.

Note that your 'pre-defined' option objects (one for each option; 1-5 + 'other') should be created in the after start-up microflow in order to be available at all.

answered