Announcement

Collapse
No announcement yet.

Include (Don't Replace) Options In a Multi Enum FIeld

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Include (Don't Replace) Options In a Multi Enum FIeld

    Hi!

    We have the following situation:
    • Inside Contacts we have a multi-enum field called "Interests" with different options "TShirts", "Pants", "Shoes".
    • Now, we are creating a workflow where we need to add (include) the interest "Shoes" to the contact, including past interests that the contact had. Example: Pants, Shoes.
    • However, when the workflow executes, it overrides the whole field and only leaves the option Shoes.
    We need to maintain the past interests of the Contact and add the "Shoes" interest to this field.

    Is it possible with a workflow, formula or BPM?

    Thanks a lot!

  • #2
    Hi Pablo,

    Multi-enum fields are implemented as arrays.

    Formula to add values to the multi-enum field while preserving previous ones:

    Code:
    yourEnumField = array\push(yourEnumField, 'New Item');
    https://docs.espocrm.com/administrat...ula/#arraypush

    Comment


    • #3
      Hi Pablo,

      Workfolw -> Actions -> Execute Formula Script

      Formula:
      interests = array\push(interests, 'Shoes');
      Last edited by Vadym; 08-06-2021, 07:43 AM.

      Comment


      • #4
        That's the one!
        Thanks a lot yuri and Vadym

        Comment

        Working...
        X