Announcement

Collapse
No announcement yet.

Array field not working for workflow conditions (and search filters)

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

  • Array field not working for workflow conditions (and search filters)

    I need to create a workflow, that sends an email only to certain contacts. Specifically, I need to target clients, who have used the trial version of our software, but not the paid version.

    I created a custom field in Contacts called Tag, which is an Array type. Each Contact can have multiple tags, such as "Evaluator" or "Customer". But when I tried to create a workflow where Tag is one of the conditions, I discovered, that I can't either choose from the list or type in any of the existing tags. I tried to create a condition with Contact.Tag -> has -> and there's an empty list. See screenshot: https://yadi.sk/i/FjYu7t9PuRpqJw

    Why is that?

    I also noticed that the Tag field is not working in the Search filters either. When I try to use Tag -> Any of - there's an input field, but whatever I type in it, doesn't affect the search results (and disappears after clicking the search button). See screenshot: https://yadi.sk/i/wLlXhjrJKs4cBw

    ------------------------

    There actually could be another solution to my initial task: can I make a condition for the workflow like that: target Deal.Contact that is not asscociated with other Deals of a certain Sale Type?

    Thank you for your help in advance.


  • #2
    Filtering by Array field w/o defined options is not implemented is EspoCRM.

    You can utilize a link multiple field istead of array.

    Comment


    • #3
      Yuri, thank you for the fast answer. How do I use a link multiple fields for that purpose? My goal is to create a condition for a workflow, where the target entity is Opportunity, and the workflow should only be triggered if the Opportunity.Contact has no other Opportunities of a certain SaleType associated with it.

      Comment


      • #4
        Regarding an array field in workflow. You can also utilize formula in workflow condition. array\includes function https://github.com/espocrm/documenta...#arrayincludes
        Last edited by yuri; 09-21-2018, 05:54 AM.

        Comment


        • #5
          Could you provide an example of a condition specified with this formula language? i.e. in my case - how do I specify, that I need the array "Tag" of the entity "Contact" associated with the target entity of the workflow ("Deal") NOT to include certain value (e.g."Customer")?

          Comment


          • #6
            if Deal could have only one Contact and field name is contact, try this
            (!array\includes(contact.tag, "Customer"))

            And remember, that "Customer" has to be the key in the Multiple-Enum list, not the translation

            Comment


            • #7
              Thank you. Actually, I've figured that out already - seems that I should have used the Relationship name instead of Field name. But thank you anyway!

              Comment


              • #8
                The ability to search by custom items for array/multi-enum fields will be available in 5.4.4.

                The ability to specify custom items for array/multi-enum in workflow conditions is already implemented in the latest advanced pack version.

                Comment

                Working...
                X