Announcement

Collapse
No announcement yet.

Access a enum value from formula

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

  • Access a enum value from formula

    Hello,

    I didn't found any post in this problem I found.

    I'm trying to fill a custom Lead field value and I need to get the value of the salutationName field which is an enum.
    When I write salutationName or entity\attribute("salutationName"), I get the key of the enum but not the value. ex: "Mr." instead of "Sir".

    Is there any way to get the value of the enum from the formula editor ?

    Thanks !

  • #2
    Could you provide the formula, you are using

    Comment


    • #3
      Use language\translateOption https://docs.espocrm.com/administrat...ranslateoption

      We call it 'label', not 'value'.

      Comment


      • #4
        The formula :
        ifThenElse(string\length(string\trim(salutationNam e)) > 0,
        salutationPhrase = string\concatenate(" ", language\translateOption(entity\attribute("salutat ionName"), "salutationName", "Lead"), " ", lastName),
        salutationPhrase = "")

        Thank you yuri, I had tried this option but it didn't give me the right result, maybe the scope argument. Now it's good.

        Comment

        Working...
        X