We are using Workflows to populate the end date for credentials for Brivo (application) users. A user can have multiple credentials on the Brivo account.
We are using a workflow which is using the Identity Attributes Change trigger.
Following are the steps.
Get Identity
Get Accounts
Check if the identity has an account on Brivo
Loop through all credentials for the user account on Brivo
We are using $.getAccounts.accounts.[?(@.sourceName == “Brivo”)].attributes.credentials[*] as the loop input.
The above jsonpath evaluates to
[
[
"credential_id1",
"credential_id2
]
]
This is creating an issue in the loop while executing a HTTP request. Inside the loop
$.loop.loopInput evaluates to [[“credential1”]]
$.loop.loopInput[0] evaluates to “credential1” but it just runs one time with first credential. The second credential is ignored.
Here’s an approach to your requirement - you would have to create another external trigger workflow and invoke that in the current workflow using Http request action.
In the current workflow instead of loop, perform Http request action and you need to pass $.getAccounts.accounts[?(@.sourceName == "Brivo")].attributes in the Post json request body and end it
In the external trigger workflow, configure loop immediately after trigger and have the loop input as $.trigger.credentials. That way your external trigger loop would invoke twice - once for each credentials, and rest of the actions can
be performed within the loop.
I think this is a bug caused during latest updates to workflow (here). Even I have noticed this behavior causing issues in iterating through the output in a workflow that was working until 2-3 days ago where reading an array was giving an output like below: