How I cane pick the attribute value inside a complex object inside a workflow?

Hello everyone, I’m implementing a workflow that sends a custom email when the provisioning is completed in the “AD” source. As you can see from this picture the workflow should send the mail only if the source is AD.


The input that the trigger receives is:

{
        "compareStrings": {
          "ChoiceList": [
            {
              "Comparator": "StringContains",
              "NextStep": "Send Email",
              "VariableA.$": "$.trigger.sources",
              "VariableB": "AD"
            }
          ],
          "DefaultStep": "End Step - Success",
          "Name": "Compare Strings",
          "SelectInput": "$",
          "SelectOutput": "$",
          "SelectResult": "$",
          "Type": "choice"
        },
        "trigger": {
          "_meta": {
            "invocationId": "d0680d9a-d471-45c9-bc42-29912cd47a7a",
            "subscriptionId": "ad66b014-658b-401c-92f5-fc7db56312b5",
            "triggerType": "FIRE_AND_FORGET"
          },
          "accountRequests": [
            {
              "accountId": "0821119994823",
              "accountOperation": "Modify",
              "attributeRequests": [
                {
                  "attributeName": "detectedRoles",
                  "attributeValue": "Abilitazione Base AD [AccessProfile-1744194129240]",
                  "operation": "Add"
                }
              ],
              "provisioningResult": "IdentityNow Task",
              "provisioningTarget": "IdentityNow",
              "source": {
                "id": "IdentityNow",
                "name": "IdentityNow",
                "type": "SOURCE"
              },
              "ticketId": null
            },
            {
              "accountId": "CN=t.juri,OU=TST,OU=Suppliers,OU=Users,OU=Web,DC=bla,DC=gt,DC=bla,DC=it",
              "accountOperation": "Create",
              "attributeRequests": [
                {
                  "attributeName": "memberOf",
                  "attributeValue": "CN=FGTPOR - SailPoint Test Group 4,OU=SailPoint,OU=Groups,OU=Web,DC=bla,DC=gt,DC=bla,DC=it",
                  "operation": "Add"
                },
                {
                  "attributeName": "ObjectType",
                  "attributeValue": "User",
                  "operation": "Add"
                },
                {
                  "attributeName": "sAMAccountName",
                  "attributeValue": "t.juri",
                  "operation": "Add"
                },
                {
                  "attributeName": "displayName",
                  "attributeValue": "Juri, Tizi (Azienda1)",
                  "operation": "Add"
                },
                {
                  "attributeName": "mail",
                  "attributeValue": "[email protected]",
                  "operation": "Add"
                },
                {
                  "attributeName": "password",
                  "attributeValue": null,
                  "operation": "Add"
                },
                {
                  "attributeName": "givenName",
                  "attributeValue": "Tizi",
                  "operation": "Add"
                },
                {
                  "attributeName": "sn",
                  "attributeValue": "Juri",
                  "operation": "Add"
                },
                {
                  "attributeName": "pwdLastSet",
                  "attributeValue": "false",
                  "operation": "Add"
                },
                {
                  "attributeName": "IIQDisabled",
                  "attributeValue": "false",
                  "operation": "Add"
                },
                {
                  "attributeName": "telephoneNumber",
                  "attributeValue": "487544499211",
                  "operation": "Add"
                },
                {
                  "attributeName": "userPrincipalName",
                  "attributeValue": "[email protected]",
                  "operation": "Add"
                },
                {
                  "attributeName": "company",
                  "attributeValue": "Azienda1",
                  "operation": "Add"
                },
                {
                  "attributeName": "employeeType",
                  "attributeValue": "Supplier",
                  "operation": "Add"
                },
                {
                  "attributeName": "extensionAttribute5",
                  "attributeValue": "AzureEnabled",
                  "operation": "Add"
                },
                {
                  "attributeName": "extensionAttribute6",
                  "attributeValue": "[email protected]",
                  "operation": "Add"
                },
                {
                  "attributeName": "extensionAttribute15",
                  "attributeValue": "[email protected]",
                  "operation": "Add"
                }
              ],
              "provisioningResult": "committed",
              "provisioningTarget": "AD",
              "source": {
                "id": "7807e0e5ca0f42b8bdc4769e5cb1f23f",
                "name": "AD",
                "type": "SOURCE"
              },
              "ticketId": null
            }
          ],
          "action": "Access Request",
          "errors": [],
          "recipient": {
            "id": "72ee6facd30e40ff8db80adcb9e5aaf3",
            "name": "Juri, Tizi (Azienda1)",
            "type": "IDENTITY"
          },
          "requester": {
            "id": "accf1e3313524f2b8dca66a977e9b190",
            "name": "test.test",
            "type": "IDENTITY"
          },
          "sources": "AD, IdentityNow",
          "trackingNumber": "af308a88f90f4ccab90465f9da2e2b90",
          "warnings": []
        }
}

In the “define variable” block i want to define the variables “recipient of the mail” and “username to send”. The first one should be the attribute value of the attribute name “mail” while the second should be the value of the attribute name “extensionAttribute6”, The poin is that these values are inside a complex object and I have difficulties in pick them. someone more experienced than me can help to retrieve these values? thanks

@s_tartaglione assuming that you need JSON path to get “mail” and “extensionAttribute6” attribute values, here is the JSON path to get the same.

$.trigger.accountRequests[?(@.provisioningTarget == 'AD')].attributeRequests[?(@.attributeName == 'mail')].attributeValue

Hi @s_tartaglione,

Try this approach and see if it helps :

  1. Use Get Identity Action
  2. Do an HTTP call to the accounts end point with request url something like this - https://YOURTENANT.api.identitynow.com/v3/accounts?filters=sourceId%20eq%20%22REPLACEYOURSOURCEIDHERE%22%20and%20identityId%20eq%20%22{{$.getIdentity.id}}%22. This will fetch you the user’s account attributes including email and ext6.
  3. You can then retrieve these attributes with $.hTTPRequest.body[*].attributes.mail and $.hTTPRequest.body[*].attributes.extensionAttribute6 and can be used in email.