# Workflow GetAccounts Query

**URL:** <https://developer.sailpoint.com/discuss/t/workflow-getaccounts-query/168205>\
**Category:** SHF Discussion and Questions\
**Tags:** isc-questions-and-answers, identity-security-cloud, workflows\
**Created:** [August 11, 2025, 3:52am UTC](https://developer.sailpoint.com/discuss/t/workflow-getaccounts-query/168205 "2025-08-11T03:52:40Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![msingh39](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@msingh39](https://developer.sailpoint.com/discuss/u/msingh39)\
**Post date:** [August 11, 2025, 3:52am UTC](https://developer.sailpoint.com/discuss/t/workflow-getaccounts-query/168205/1 "2025-08-11T03:52:40Z")

</div>

Team,

I am creating a workflow to check if any user having source, say “AD” is in disabled state, then update it to enable state when IdentityAttribute change happened. After “Get Account” action, I am using “Check Account State“ with below json to check if true or false. But it is always evaluating to FALSE.

Tried different paths like below:-

$.getAccounts.accounts[?(@.attributes.sourceName == ‘AD’ && @.attributes.disabled == true)].attributes.disabled[0]

$.getAccounts.accounts[?(@.sourceName == ‘AD’)].IIQDisabled

$.getAccounts.accounts[?(@.sourceName == ‘AD’)].disabled

Am I missing something? User can have multiple sources like Entra, Azure etc.

But

---

<div class="post-metadata">

**Author:** ![Abhinov7](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/abhinov7/32/13253_2.png) [@Abhinov7](https://developer.sailpoint.com/discuss/u/Abhinov7)\
**Post date:** [August 11, 2025, 8:38am UTC](https://developer.sailpoint.com/discuss/t/workflow-getaccounts-query/168205/2 "2025-08-11T08:38:56Z")

</div>

Hi,

You can user $.getAccounts.accounts[?(@.sourceName == ‘AD’)].disabled and compare boolean instead of compare strings.

I tried in workflow and its working fine.

Check and let me know if you still cannot work.

-Abhinov

---

<div class="post-metadata">

**Author:** ![msingh39](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@msingh39](https://developer.sailpoint.com/discuss/u/msingh39)\
**Post date:** [August 12, 2025, 11:30pm UTC](https://developer.sailpoint.com/discuss/t/workflow-getaccounts-query/168205/3 "2025-08-12T23:30:00Z")

</div>

Thanks, let me try and confirm on this.

---

<div class="post-metadata">

**Author:** ![msingh39](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@msingh39](https://developer.sailpoint.com/discuss/u/msingh39)\
**Post date:** [August 12, 2025, 11:37pm UTC](https://developer.sailpoint.com/discuss/t/workflow-getaccounts-query/168205/4 "2025-08-12T23:37:34Z")

</div>

> [@Abhinov7](#):
>
> $.getAccounts.accounts[?(@.sourceName == ‘AD’)].disabled

I tried it but didn’t worked. Below is what the input it (masked and removed other variables). Since this user has multiple sources so wondering if the json path is correct or not.

Tried:

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/1/e/1e5a33b0c9795ba3bd980c792beb0afc47c314bf.png)

Input for Step logs:

“getAccounts”: {  
“accounts”: [  
{  
“attributes”: {  
“IIQDisabled”: “true”,  
“IIQLocked”: false,  
“accountEnabled”: true,  
“city”: “xyz”,  
“country”: “xyz”,  
“department”: “Uxxxxxth”,  
“dirSyncEnabled”: true,  
“disabled”: true,  
“sourceName”: “NONAD-Source”,  
“systemAccount”: false,  
“type”: null,  
“uncorrelated”: false,  
“uuid”: null  
},  
{  
“attributes”: null,  
“uuid”: null  
},  
{  
“attributes”: {  
“disabled”: true,  
“sourceName”: “AD”,

```auto
          "systemAccount": false,
          "type": null,
          "uncorrelated": false }}}]}

```

---

<div class="post-metadata">

**Author:** ![Abhinov7](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/abhinov7/32/13253_2.png) [@Abhinov7](https://developer.sailpoint.com/discuss/u/Abhinov7)\
**Post date:** [August 13, 2025, 2:33am UTC](https://developer.sailpoint.com/discuss/t/workflow-getaccounts-query/168205/5 "2025-08-13T02:33:12Z")

</div>

Hi,

Attached the workflow which worked fine for me. Hope this helps.

[IDNAttributeschanged20250813.json](https://developer.sailpoint.com/discuss/uploads/short-url/cjFvZMpwuUckkLlOBWGYQgloLWg.json) (1.8 KB)

-Abhinov

---

<div class="post-metadata">

**Author:** ![msingh39](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@msingh39](https://developer.sailpoint.com/discuss/u/msingh39)\
**Post date:** [August 13, 2025, 4:09am UTC](https://developer.sailpoint.com/discuss/t/workflow-getaccounts-query/168205/7 "2025-08-13T04:09:22Z")

</div>

Thanks, it worked 🙂 Now I will be setting up based on search query.

---

<div class="post-metadata">

**Author:** ![msingh39](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@msingh39](https://developer.sailpoint.com/discuss/u/msingh39)\
**Post date:** [August 13, 2025, 4:15am UTC](https://developer.sailpoint.com/discuss/t/workflow-getaccounts-query/168205/8 "2025-08-13T04:15:16Z")

</div>

Have you done that before? Picking users from search query or based on specific lifecycle state (like user moved from disabled to active state) and then it will enable the source account. That would be helpful 🙂

---

<div class="post-metadata">

**Author:** ![Abhinov7](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/abhinov7/32/13253_2.png) [@Abhinov7](https://developer.sailpoint.com/discuss/u/Abhinov7)\
**Post date:** [August 13, 2025, 8:57am UTC](https://developer.sailpoint.com/discuss/t/workflow-getaccounts-query/168205/9 "2025-08-13T08:57:43Z")

</div>

If you want to enable account when they changed LCS then you can add it in provisioning tab, No need of workflow.

-Abhinov

---

<div class="post-metadata">

**Author:** ![msingh39](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@msingh39](https://developer.sailpoint.com/discuss/u/msingh39)\
**Post date:** [August 13, 2025, 11:41pm UTC](https://developer.sailpoint.com/discuss/t/workflow-getaccounts-query/168205/10 "2025-08-13T23:41:41Z")

</div>

Yes, I have that option and putting it to test.

QQ, if user does not have that source assigned yet, will system tried to create it when that lifecyclestate get processed?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [October 12, 2025, 11:41pm UTC](https://developer.sailpoint.com/discuss/t/workflow-getaccounts-query/168205/11 "2025-10-12T23:41:58Z")

</div>

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