Announcement

Collapse
No announcement yet.

Formula LIKE statement?

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

  • Formula LIKE statement?

    Is there an option for Formula's similar to the MySQL LIKE statement available or even a work around?

  • #2
    https://www.espocrm.com/documentatio...stringcontains

    Comment


    • #3
      string\contains(STRING, NEEDLE) Whether STRING contains NEEDLE. (since version 5.1.2)

      Something like this?

      string\contains(video, public)

      video is my field name and public would be what i'm looking for

      Comment


      • #4
        here - with quotes (' ') means some string, without - field name

        string\contains(video, public) - field video contains a field public
        string\contains(video, 'public') - field video contains a word public

        Comment


        • khopper
          khopper commented
          Editing a comment
          Thank you as always for the clarification!

      • #5
        I noticed that it is case sensitive, is there a way to make it not case sensitive?


        Code:
        ifThen (
            client == 'COMCAST' && term == '24 Mo',
            commission = ifThenElse (
                voice == 'New',
                (
                    ccblmrc + ccfflmrc + ccmlmrc - discountvoice
                ) * 0.5,
                0
            ) + ifThenElse (
                internet == 'New',
                (ccimrc - discountinternet) * 0.5,
                0
            ) + ifThenElse (
                video == 'New' && (
                    string \ CONTAINS (ccbcvideo, 'private')
                ),
                (ccvmrc - discountvideo) * 0.5,
                0
            ) + ifThenElse (
                video == 'New' && (
                    string \ CONTAINS (ccbcvideo, 'public')
                ),
                (ccvmrc - discountvideo) * 1.5,
                0
            ) + ifThenElse (
                phonesystemcommission != NULL,
                phonesystemcommission,
                0
            )
        );
        Last edited by khopper; 07-20-2018, 10:13 PM.

        Comment


        • #6
          https://github.com/espocrm/documenta...tringlowercase
          string\contains(string\lowerCase(ccbcvideo), 'public')

          Comment


          • khopper
            khopper commented
            Editing a comment
            Thank you!
        Working...
        X