Workflow Loop is not working for multiple condition?

Hi All,
I have defined the WF and use the loop to get the multiple UPN from Entra ID source but recieving the “Unexpected End of JSON input”.

I want to get the UPN from multiple Entra ID source for the same user and revoke the signInSessions.


In the HTTP Request i have given https://graph.microsoft.com/v1.0/users/{{$.loop.loopInput.input}}/revokeSignInSessions

{
“loopOutput”: {
“failureItems”: [
{
“errorMessage”: “unexpected end of JSON input”,
“payload”: null
},
{
“errorMessage”: “unexpected end of JSON input”,
“payload”: null
}
],
“successfulItems”: null
}
}

Any one resolved this issue or find the solution???

Thanks,
Shantha Kumar

Hi @Santhakumar ,

I believe we cannot use filtered JSON expression in the input .
Instead take all the accounts and use compare string operator in the loop .

Thanks

I have tested this in dev tenant its working fine for me, but it’s not working for fedramp tenant. If we can proceed with compare strings can you give me the outline.

If i use compare strings what i can give this in next http request.

https://graph.microsoft.com/v1.0/users/{{upn}}/revokeSignInSessions

The loop input which is accountId and satisfies sourceName , need to act in next operation , thus the the account id is : {{$.loop.loopInput.id}}

For the HTTP operation i don’t need an id/name i need an upn from the Entra ID source. How can i achieve this??

So , for an account who is on ENTRA Source , get that accounts upn value ?
If my understanding is correct
Use Get Accounts by Account ID after compare strings true

And now , the upn id will be {{$.getAccounts.accounts[0].attributes.upn}} , after this step add http and use upn .

1 Like

Tried this but still facing the same error Unexpected end of JSON string.

Download the Workflow Execution And check if you can find which step is throwing error .
Send the workflow execution if possible


I have seen this error in the WF.

Do all of your accounts have the attribute userprincipal name defined

Yes all are having UPN.

What is the URL that is you are passing in the Request URL

https://graph.microsoft.com/v1.0/users/{{$.getAccounts.accounts[0].attributes.upn}}/revokeSignInSessions

You should be using

{{$.loop.loopInput.name}}

to get the respective name about the account you sending to Http Request step. I don’t know what is the variable that you are fetching from account and sending into request, but you have to fetch like this according to your JSON response from “Get Accounts”

{{$.loop.loopInput.variableName}}

See the sameple json from GetAccounts. You can check in your tenant what sample json you will get on “Get Accounts” step and use it accordingly. Actions - SailPoint Identity Services

I have already tried define variable to store the loop.loopInput it’s storing the upn values but when I tried to use $.defineVariable it was coming as empty outside the loop

Another thing you can check is, instead of using filter in Loop block, filter Accounts in “Get Accounts” block to filter only “Entra Id” accounts and send whole array in loop in next step and fetch the respective variable of array that will be sent in http request like the way I mentioned above.

I have tried this but i cannot filter the source in the GetAccounts. Can you send the working json file if you have one. Or did i do something wrong
LoopWF20241127.json (2.1 KB)

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.