# Using Workflow to disable accounts in a specific source

**URL:** <https://developer.sailpoint.com/discuss/t/using-workflow-to-disable-accounts-in-a-specific-source/151349>\
**Category:** SHF Discussion and Questions\
**Tags:** identity-security-cloud, workflows\
**Created:** [July 3, 2025, 7:17pm UTC](https://developer.sailpoint.com/discuss/t/using-workflow-to-disable-accounts-in-a-specific-source/151349 "2025-07-03T19:17:09Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![HPatel](https://avatars.discourse-cdn.com/v4/letter/h/7ab992/32.png) [@HPatel](https://developer.sailpoint.com/discuss/u/HPatel)\
**Post date:** [July 3, 2025, 7:17pm UTC](https://developer.sailpoint.com/discuss/t/using-workflow-to-disable-accounts-in-a-specific-source/151349/1 "2025-07-03T19:17:09Z")

</div>

I am building a workflow to disable account in a specific source on an attribute change. I am able to read and disable all accounts using GetAccounts and ManageAccounts Actions. However, I am not able to Loop through accounts and disable them only for a specific source ID.

Have anyone been able to build workflow using loop for the similar business process?

Any help will be appreciated.

Thank you  
Haresh Patel

I

---

<div class="post-metadata">

**Author:** ![iamnithesh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamnithesh/32/42445_2.png) [@iamnithesh](https://developer.sailpoint.com/discuss/u/iamnithesh)\
**Post date:** [July 3, 2025, 7:20pm UTC](https://developer.sailpoint.com/discuss/t/using-workflow-to-disable-accounts-in-a-specific-source/151349/2 "2025-07-03T19:20:40Z")

</div>

If you share your current workflow, it will be easier to suggest specific solution based on current config

---

<div class="post-metadata">

**Author:** ![HPatel](https://avatars.discourse-cdn.com/v4/letter/h/7ab992/32.png) [@HPatel](https://developer.sailpoint.com/discuss/u/HPatel)\
**Post date:** [July 3, 2025, 7:20pm UTC](https://developer.sailpoint.com/discuss/t/using-workflow-to-disable-accounts-in-a-specific-source/151349/3 "2025-07-03T19:20:42Z")

</div>

![DISABLESHAREDMAILBOX20250703](https://global.discourse-cdn.com/sailpoint/original/3X/8/4/84326b56e44b57a421f104bf8f9faaa1cca9fea8.png)

---

<div class="post-metadata">

**Author:** ![HPatel](https://avatars.discourse-cdn.com/v4/letter/h/7ab992/32.png) [@HPatel](https://developer.sailpoint.com/discuss/u/HPatel)\
**Post date:** [July 3, 2025, 7:25pm UTC](https://developer.sailpoint.com/discuss/t/using-workflow-to-disable-accounts-in-a-specific-source/151349/4 "2025-07-03T19:25:12Z")

</div>

Loop Input = $.getAccounts.accounts  
Loop Context = $.getAccounts.sourceId

Compare String  
Value1 = $.loop.loopInput.sourceId  
Value2 = “Actual SourceID”

Manage Accounts  
Disable Account  
Select Accounts = $.loop.loopInput.accounts[\*].id

---

<div class="post-metadata">

**Author:** ![iamnithesh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamnithesh/32/42445_2.png) [@iamnithesh](https://developer.sailpoint.com/discuss/u/iamnithesh)\
**Post date:** [July 3, 2025, 7:46pm UTC](https://developer.sailpoint.com/discuss/t/using-workflow-to-disable-accounts-in-a-specific-source/151349/5 "2025-07-03T19:46:59Z")

</div>

If the workflow is handling a single identity and account needs to be deleted from just one source, then you don’t need to use the loop. You can simply apply a filter like  
`$.getAccounts.accounts[?(@.sourceId == '2c9180835d2e5168015d32f890ca1581')].id` and use it as input to `Manage Accounts` action

Replace `2c9180835d2e5168015d32f890ca1581` with actual Source ID

---

<div class="post-metadata">

**Author:** ![HPatel](https://avatars.discourse-cdn.com/v4/letter/h/7ab992/32.png) [@HPatel](https://developer.sailpoint.com/discuss/u/HPatel)\
**Post date:** [July 3, 2025, 8:00pm UTC](https://developer.sailpoint.com/discuss/t/using-workflow-to-disable-accounts-in-a-specific-source/151349/6 "2025-07-03T20:00:59Z")

</div>

> [@iamnithesh](#):
>
> .getAccounts.accounts[?(@.sourceId == ‘2c9180835d2e5168015d32f890ca1581’)].id

Thank you very much for your help.

This change did the trick. However, I wonder what’s wrong with the loop? Anyway to make that work?

---

<div class="post-metadata">

**Author:** ![iamnithesh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamnithesh/32/42445_2.png) [@iamnithesh](https://developer.sailpoint.com/discuss/u/iamnithesh)\
**Post date:** [July 3, 2025, 8:08pm UTC](https://developer.sailpoint.com/discuss/t/using-workflow-to-disable-accounts-in-a-specific-source/151349/7 "2025-07-03T20:08:44Z")

</div>

try this  
`$.loop.loopInput.id`  
instead of

> [@HPatel](#):
>
> $.loop.loopInput.accounts[\*].id

---

<div class="post-metadata">

**Author:** ![HPatel](https://avatars.discourse-cdn.com/v4/letter/h/7ab992/32.png) [@HPatel](https://developer.sailpoint.com/discuss/u/HPatel)\
**Post date:** [July 3, 2025, 8:25pm UTC](https://developer.sailpoint.com/discuss/t/using-workflow-to-disable-accounts-in-a-specific-source/151349/8 "2025-07-03T20:25:33Z")

</div>

For some reason, test workflow shows no input for compare string step

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/2/b/2b27f39fd63bcc598691ee1ae775d80b6eff9587.png)

---

<div class="post-metadata">

**Author:** ![HPatel](https://avatars.discourse-cdn.com/v4/letter/h/7ab992/32.png) [@HPatel](https://developer.sailpoint.com/discuss/u/HPatel)\
**Post date:** [July 3, 2025, 8:47pm UTC](https://developer.sailpoint.com/discuss/t/using-workflow-to-disable-accounts-in-a-specific-source/151349/9 "2025-07-03T20:47:36Z")

</div>

Thanks for all your help.

Even though I don’t see any data in compare string step, it actually works.

---

<div class="post-metadata">

**Author:** ![iamnithesh](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/iamnithesh/32/42445_2.png) [@iamnithesh](https://developer.sailpoint.com/discuss/u/iamnithesh)\
**Post date:** [July 3, 2025, 11:10pm UTC](https://developer.sailpoint.com/discuss/t/using-workflow-to-disable-accounts-in-a-specific-source/151349/10 "2025-07-03T23:10:41Z")

</div>

Yeah you don’t see the data for steps inside a loop… time to mark the response as Solution? 😃

---

<div class="post-metadata">

**Author:** ![HPatel](https://avatars.discourse-cdn.com/v4/letter/h/7ab992/32.png) [@HPatel](https://developer.sailpoint.com/discuss/u/HPatel)\
**Post date:** [July 7, 2025, 12:04pm UTC](https://developer.sailpoint.com/discuss/t/using-workflow-to-disable-accounts-in-a-specific-source/151349/11 "2025-07-07T12:04:42Z")

</div>

yeah. Just marked it. Thanks.

---

<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:** [September 5, 2025, 12:05pm UTC](https://developer.sailpoint.com/discuss/t/using-workflow-to-disable-accounts-in-a-specific-source/151349/12 "2025-09-05T12:05:26Z")

</div>

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