How do I set the value of an enum attribute when creating / changing an object?

I'd like to use enums for the values of finite fields (e.g. status = {'not started', 'in progress', 'complete'}. I have figured out that I access the value as a string through getCaption, but how do I set a value? When I create an object witn an enum attribute, I may want to set it's value in the microflow; same for a process that may wish to change it. I can't put 'complete' or 1 into the Value box as it expects something of type enum. Seems like there should be a getEnumByCaption type of function. I'm hoping that the answer is not to write one microflow for each enum that accepts a string parameter and then iterates through the enum to find the correct one...
4 answers

Hi Rob,

  You are correct that tou can't set the value by simply typing 'complete.'  The way to reference enumerations is through referencing the enumeration value in the following way through the equation dialogue:



For example, pretend I had an enumeration 'RegistrationStatus' for my object 'Registration' that lived in my 'Workflow' module.  If I wanted to set it to 'Complete,'  I would use a change activity on the Status attribute using the following reference:


If you hit 'Ctrl' + 'Space' while using the dialogue box you can find this more easily.

To further get into this, let's look at the use case where you have a String field 'statusString' and want to translate it into an enumeration, you will need some logic in your change activity that looks like this:

if $statusString = 'Complete' then


else if $statusString = 'Not Started' then


else if$statusString = 'in progress' then



Hope this helps!




Hi VAlerio Guastella,

In your change object you are using object value which is denoted by $. Instead you should use the Enum directly.  Type the Enumeration name and you will get your enumeration in the suggestions.


Hope this Helps.


Although I agree with Rob as the best way, you technically could set the value by just setting it equal to string value x, where it would look like RegistrationStatus = 'Complete'. It will work but it is hard coded and if you change the caption values of the enum, this method won't update. So while it works I would use what Rob posted and I just wanted you to be aware of this example.


HI All,


I am trying to execute a similar task. I would like to give a new status to an attribute of an object once a button is clicked. The button will call a microflow where i am using a change object activity. Howver, it doesn’t seem to recognize the status. Can somebody help pls?