Workflow to remove all access that contains "Managed Users"

Need to remove the groups based on below conditions

  1. Type = Entitlement
  2. Source Name = Active Directory - Users
  3. Value Contains “Managed Users”

The below filter is working fine to remove all the groups for 1st 2 conditions
$.hTTPRequest.body[0].access[?(@.type == “ENTITLEMENT” && @.source.name == “Active Directory - Users”)] but when i try to include the 3rd condtion the workflow breaks or skips the Loop.

Filters I have tried till now:

  1. $.hTTPRequest.body[0].access[?(@.type == “ENTITLEMENT” && @.source.name == “Active Directory - Users” && ‘Managed Users’ in @.value )]
  2. $.hTTPRequest.body[0][?(@.type == “ENTITLEMENT” && @.source.name == “Active Directory - Users” && @.value =~ /.Managed Users./)]
    3)$.hTTPRequest.body[0].access[?(@.type == “ENTITLEMENT” && @.source.name == “Active Directory - Users” && contains(@.value, ‘Managed Users’))]
1 Like

Hello @Yathish ;

Can you try on of this filter ?

$.hTTPRequest.body[0].access[?(@.type == “ENTITLEMENT” && @.source.name == “Active Directory - Users” && @.value contains "Managed Users")]
$.hTTPRequest.body[0].access[?(@.type == “ENTITLEMENT” && @.source.name == “Active Directory - Users” && @.value in [‘Managed Users’])]

Hi @baoussounda , Thanks for the response

Both the filters are not working, The Workflow just skips the loop as usual

In the image above, i have used both the filters on Loop and only this filter on Verify datatype $.hTTPRequest.body[0].access[?(@.type == “ENTITLEMENT” && @.source.name == “Active Directory - Users”)]

In the Loop Filter it takes as data not exist…

1 Like

Hello,

Indeed, adding additional steps outside of the loop between the Loop operator and the end step is not recommended. Please refer to the SP doc.

Do not hesitate to share the workflow script and the need.

Regards,

Where you use your filter.

Can you please add screeshot ?

Using this workflow as reference : Workflow to remove access by identity based on special conditions

Attaching the Screenshot of where I’m using the filter

1 Like

After your test execution, you can click on loop and see input data at loop level.

You can retrieve this input test filter on this input here : Online JSONPath Evaluator Tool (javainuse.com)

@baoussounda, The Filter $.hTTPRequest.body[0].access[?(@.type == “ENTITLEMENT” && @.source.name == “Active Directory - Users” && @.value contains “Managed Users”)] ]is working fine in the website, But these are the observations i found in the workflow

  1. When using the filter without contains just the 1st 2 conditions the LoopInput have data

  2. Whenever we put Contains then the loop’s “input” becomes null as shown below
    image

1 Like

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