Genesys Cloud - Developer Community!

 View Only

Sign Up

  • 1.  Triggers - Check For Multiple Values Within One Condition

    Posted 10-14-2025 16:54

    Hello,

    I am trying to create a trigger with multiple values in one condition and I can't even get it to match unfortunately. Basically I want to check the divisionIds for the v2.quality.evaluations trigger. Here is the results I'm getting:

    Whether or not I have 1 or two values in the array, it says it's not matching. I'm just trying to figure out what I am doing wrong. Here's the full response if that helps as well for the 2nd test:

        "jsonPathValidation": {
            "name": "Check jsonPath match criteria",
            "step": 3,
            "matches": false,
            "details": [
                {
                    "jsonPath": "divisionIds",
                    "operator": "In",
                    "values": [
                        "85d81a9a-68c6-492a-bdda-3311a95da2ec",
                        "da20c273-3ab9-4fa3-b3b7-1bd4530bbe9d"
                    ],
                    "generatedJsonPathCondition": "divisionIds",
                    "match": false,
                    "jsonPathExtraction": [
                        {
                            "value": [
                                "85d81a9a-68c6-492a-bdda-3311a95da2ec"
                            ],
                            "path": "$['divisionIds']"
                        }
                    ]
                }


    #Triggers

    ------------------------------
    Tristen Schwarzenberger
    IT Engineer
    GCP
    ------------------------------


  • 2.  RE: Triggers - Check For Multiple Values Within One Condition
    Best Answer

    Posted 10-14-2025 17:38

    Hi Tristen,

    The IN operator only works when the event field (jsonPath) has a single value, for example:

    "divisionId": "abc123"

    In this case, Genesys checks if that single value is included in the list you provided.

    However, the divisionIds field in the event returns a list of values, like this:

    "divisionIds": ["id1", "id2", "id3"]

    When you use IN on a field that's a list, Genesys tries to compare the entire list (["id1","id2","id3"]) against your provided values, and that never matches, because it doesn't compare item by item. That's why IN doesn't work in this case.

    The option would be CONTAINS, because it is designed for fields that return lists (arrays). It checks if the field contains a specific value within that list.

    However, the "Value" field in the interface only accepts one value at a time, so you can't enter multiple IDs at once (as a list).

    Therefore, if you want the trigger to fire for more than one ID, the right approach is to create one trigger per ID that you want to monitor.



    ------------------------------
    Elisson Fernandes
    ------------------------------



  • 3.  RE: Triggers - Check For Multiple Values Within One Condition

    Posted 10-14-2025 17:43
    Edited by Tristen Schwarzenberger 10-14-2025 17:43

    Thank you for the reply, Elisson! Sorry I had my other reply drafted before I saw yours. That was was I figured. When I change the path to divisionIds[0] it is working regardless of what value I have at the first index of the array. I even tried changing the test input and as long as the value is in the array it seems to work. What might fail though is if somehow there are multiple divisions, but haven't tested that yet.



    ------------------------------
    Tristen Schwarzenberger
    IT Engineer
    GCP
    ------------------------------



  • 4.  RE: Triggers - Check For Multiple Values Within One Condition

    Posted 10-14-2025 18:13

    That's correct, if there are multiple divisionIds, it won't work properly because using [0] only pulls the first item of the array for comparison.

    I had a similar situation a few months ago with the v2.users.{id}.activity topic, where I needed to compare the activeQueueIds field against five specific queue IDs. However, since this field contains all active queues for the agent, some users had up to ten IDs in that list.

    Because of that, I switched to using the CONTAINS operator, and the solution was to create one trigger per ID.



    ------------------------------
    Elisson Fernandes
    ------------------------------



  • 5.  RE: Triggers - Check For Multiple Values Within One Condition

    Posted 10-15-2025 10:02

    Elisson I really appreciate the help! Thank you for all the information! I think I will end up using 2 triggers, or maybe find a different value to query for. 



    ------------------------------
    Tristen Schwarzenberger
    IT Engineer
    GCP
    ------------------------------



  • 6.  RE: Triggers - Check For Multiple Values Within One Condition

    Posted 10-15-2025 14:13

    I'm really glad I could help!



    ------------------------------
    Elisson Fernandes
    ------------------------------



  • 7.  RE: Triggers - Check For Multiple Values Within One Condition

    Posted 10-14-2025 17:41

    Well after a lot of tinkering around, it looks like just changing the path to "divisionIds[0]" fixed it!



    ------------------------------
    Tristen Schwarzenberger
    IT Engineer
    GCP
    ------------------------------