Change of attribute type from boolean to enumeration

0
I have a situation, in a form there used to be only two answers to a question ‘Yes’ or ‘No’, so I made the answer attribute as boolean. Now, the user is asking for a third option as well, which is obviously not possible with type boolean, so I made it as enumeration. Now there are already a lot of forms filled in and if I change the type of attribute, the data from previous forms will be lost. One way is to create a microflow and copy all the answers from that old boolean attribute to the new enumeration attribute. Any other way, in which I can solve this?
asked
1 answers
4

Hello Shreyash,

you could migrate the data from boolean to enumeration by an script microflow.

  • First step would be to set the new attribute on your entity
  • In the second step create a script microflow to convert the boolean value to the correct enumeration value
  • Check your data
  • Remove the boolean, if not required anymore. Make sure the data has been migrated correctly.

 

By using this action, you should handle the script in a batch. If you’re not sure about this pattern, take a look in the Academy. There is a description in a learning path about it.

 

 

answered