Filter Provisioning Completed trigger in Workflows

I am working on a similar filter. I want to trigger a workflow when a account is provisioned during a joiner event for a particular source but it’s still triggering the workflow for all scenarios. The trigger event is “ProvisioningCompleted

Below is the input to the workflow & filter I am using

Filter - $.input.accountRequests[?(@.accountOperation == “Create” && @.provisioningResult== “committed” && @.provisioningTarget == “Active Directory”)]

Json Input taken from workflow execution

{
    "input": {
        "_meta": {
            "invocationId": "67572a06-36e9-4cce-988b-4d80bdae7b34",
            "subscriptionId": "39c88073-99cf-4d63-bc4b-ce34eae01ceb",
            "triggerType": "FIRE_AND_FORGET"
        },
        "accountRequests": [
            {
                "accountId": "CN=TEST_Heno spTestFron,OU=TEST,DC=com",
                "accountOperation": "Create",
                "attributeRequests": [
                    {
                        "attributeName": "displayName",
                        "attributeValue": "Heno Fron",
                        "operation": "Add"
                    },
                    {
                        "attributeName": "givenName",
                        "attributeValue": "Heno",
                        "operation": "Add"
                    },
                    {
                        "attributeName": "sn",
                        "attributeValue": "spTestFron",
                        "operation": "Add"
                    },
                    {
                        "attributeName": "title",
                        "attributeValue": "Temporary Worker",
                        "operation": "Add"
                    }
                ],
                "provisioningResult": "committed",
                "provisioningTarget": "Active Directory",
                "source": {
                    "id": "2c91808682c683220182cd428d0a6b68",
                    "name": "Active Directory",
                    "type": "SOURCE"
                },
                "ticketId": null
            },
            {
                "accountId": "CN=TEST_spTestFron, Heno,OU=TEST,DC=com",
                "accountOperation": "Create",
                "attributeRequests": [
                    {
                        "attributeName": "memberOf",
                        "attributeValue": "CN=Test_WorkdayUsers,OU=TEST,DC=com",
                        "operation": "Add"
                    },
                    {
                        "attributeName": "ObjectType",
                        "attributeValue": "User",
                        "operation": "Add"
                    },
                    {
                        "attributeName": "department",
                        "attributeValue": "Business Systems",
                        "operation": "Add"
                    },
                    {
                        "attributeName": "pwdLastSet",
                        "attributeValue": "false",
                        "operation": "Add"
                    }
                ],
                "provisioningResult": "committed",
                "provisioningTarget": "Ldap",
                "source": {
                    "id": "2c91808682c683220182cd4287486b63",
                    "name": "Ldap",
                    "type": "SOURCE"
                },
                "ticketId": null
            },
            {
                "accountId": "50009",
                "accountOperation": "Modify",
                "attributeRequests": [
                    {
                        "attributeName": "assignedRoles",
                        "attributeValue": "Employee - Secondary AD Account [cloudRole-1663090919617]",
                        "operation": "Add"
                    }
                ],
                "provisioningResult": "IdentityNow Task",
                "provisioningTarget": "IdentityNow",
                "source": {
                    "id": "IdentityNow",
                    "name": "IdentityNow",
                    "type": "SOURCE"
                },
                "ticketId": null
            }
        ],
        "action": "Identity Refresh",
        "errors": [],
        "recipient": {
            "id": "7895a8f3bc404a0bbc6f52fbc452dbcd",
            "name": "Heno Fron",
            "type": "IDENTITY"
        },
        "requester": {
            "id": "2c9180837fdb6d35017fe1bcf29026b2",
            "name": "SYSTEM",
            "type": "IDENTITY"
        },
        "sources": "Active Directory, IdentityNow, Ldap",
        "trackingNumber": "14a7dabb05a04bf7a55e850a9d2db1ea",
        "warnings": []
    }
}

Hey @tanaychouhan1 ! Welcome to the community! Make sure to mark an answer as a Solution so it can be found by others! :slight_smile: I found this post extremely helpful since I always come to these forums first when I run into a wall I can’t climb. :slight_smile:

Both @sharvari and @alexandre_mazars post’s were helpful to me too and I was able to build what I needed from their responses. Good luck choosing the person who gets marked as the Solution! XD hahahah!

Thanks for the great post and Welcome!

Hi Tanay.

When specifying trigger filters, you don’t need to include the input in the JSONpath. Try the following JSONpath.

$.accountRequests[?(@.accountOperation == “Create” && @.provisioningResult== “committed” && @.provisioningTarget == “Active Directory”)]

Hi Colin, I have already tried that still the workflow triggers every time.

can you share a screenshot of how you configured your event trigger step in your workflow?

This filter seems to working fine. If you have copy pasted it from somewhere i suggest, you delete and retype in the double quotes in the filter box. I have come across this issue and doing that helped the filter to work.