# Search query to fetch account attributes

**URL:** <https://developer.sailpoint.com/discuss/t/search-query-to-fetch-account-attributes/162396>\
**Category:** SHF Discussion and Questions\
**Tags:** apis, identity-security-cloud\
**Created:** [July 31, 2025, 1:59pm UTC](https://developer.sailpoint.com/discuss/t/search-query-to-fetch-account-attributes/162396 "2025-07-31T13:59:47Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![nidhipriya](https://avatars.discourse-cdn.com/v4/letter/n/958977/32.png) [@nidhipriya](https://developer.sailpoint.com/discuss/u/nidhipriya)\
**Post date:** [July 31, 2025, 1:59pm UTC](https://developer.sailpoint.com/discuss/t/search-query-to-fetch-account-attributes/162396/1 "2025-07-31T13:59:47Z")

</div>

Hello Community,

I have been trying to fetch the account attributes of a AD source, based on that result to build a workflow .  
but i don’t see any supportive doc related to fetch value related accounts

ex: @accounts(source.name:xyz )AND account.samAccountname

Has anybody came across such situation to filter these results?  
any API which will give account attribute details?

---

<div class="post-metadata">

**Author:** ![HussainshaSyed001](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/hussainshasyed001/32/28234_2.png) [@HussainshaSyed001](https://developer.sailpoint.com/discuss/u/HussainshaSyed001)\
**Post date:** [July 31, 2025, 2:20pm UTC](https://developer.sailpoint.com/discuss/t/search-query-to-fetch-account-attributes/162396/2 "2025-07-31T14:20:47Z")

</div>

you want to know, for example samAccountname for a user?

---

<div class="post-metadata">

**Author:** ![nidhipriya](https://avatars.discourse-cdn.com/v4/letter/n/958977/32.png) [@nidhipriya](https://developer.sailpoint.com/discuss/u/nidhipriya)\
**Post date:** [July 31, 2025, 2:21pm UTC](https://developer.sailpoint.com/discuss/t/search-query-to-fetch-account-attributes/162396/3 "2025-07-31T14:21:50Z")

</div>

not that attributes.. A date attribute coming from a source

---

<div class="post-metadata">

**Author:** ![HussainshaSyed001](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/hussainshasyed001/32/28234_2.png) [@HussainshaSyed001](https://developer.sailpoint.com/discuss/u/HussainshaSyed001)\
**Post date:** [July 31, 2025, 2:25pm UTC](https://developer.sailpoint.com/discuss/t/search-query-to-fetch-account-attributes/162396/4 "2025-07-31T14:25:00Z")

</div>

please clarify: do you need see date info of a particular identity of some xyz source?

---

<div class="post-metadata">

**Author:** ![bhaskar-kancherla](https://avatars.discourse-cdn.com/v4/letter/b/bc8723/32.png) [@bhaskar-kancherla](https://developer.sailpoint.com/discuss/u/bhaskar-kancherla)\
**Post date:** [July 31, 2025, 2:32pm UTC](https://developer.sailpoint.com/discuss/t/search-query-to-fetch-account-attributes/162396/5 "2025-07-31T14:32:05Z")

</div>

You can use below api to get the account attributes of an identity.

/v3/accounts?filters=identityId eq “identityid” and source.name eq “Azure Active Directory”

---

<div class="post-metadata">

**Author:** ![smukhija](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/smukhija/32/3759_2.png) [@smukhija](https://developer.sailpoint.com/discuss/u/smukhija)\
**Post date:** [July 31, 2025, 2:32pm UTC](https://developer.sailpoint.com/discuss/t/search-query-to-fetch-account-attributes/162396/6 "2025-07-31T14:32:42Z")

</div>

> [@nidhipriya](#):
>
> Has anybody came across such situation to filter these results?  
> any API which will give account attribute details?

You should be able use the API [https://xxxx.api.identitynow.com/v3/accounts/](https://xxxx.api.identitynow.com/v3/accounts/) to pull the required details instead of using search query in workflow.

---

<div class="post-metadata">

**Author:** ![rohit\_wekhande](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/rohit_wekhande/32/28501_2.png) [@rohit\_wekhande](https://developer.sailpoint.com/discuss/u/rohit_wekhande)\
**Post date:** [July 31, 2025, 2:37pm UTC](https://developer.sailpoint.com/discuss/t/search-query-to-fetch-account-attributes/162396/7 "2025-07-31T14:37:30Z")

</div>

Hello, As far as I know, you can only fetch the Identity attributes using attribute. but not the account attributes which are present in account schema.

Using the Rich REST APIs of SailPoint ISC, you can achieve that but not through Search Queries.

---

<div class="post-metadata">

**Author:** ![nidhipriya](https://avatars.discourse-cdn.com/v4/letter/n/958977/32.png) [@nidhipriya](https://developer.sailpoint.com/discuss/u/nidhipriya)\
**Post date:** [August 5, 2025, 3:51pm UTC](https://developer.sailpoint.com/discuss/t/search-query-to-fetch-account-attributes/162396/8 "2025-08-05T15:51:23Z")

</div>

Hi All,  
I m using search query(v3/search) to identity “disabled=false” accounts and trying to fetch account id by using this expression in a variable.  
however its not substituting any value.  
is something wrong with this expr  
$.hTTPRequest.body.accounts[?(@.sourceName==‘xyz’)].id

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/0/3/034a0451289cb9bada983575f99350f3719e2023.png)

---

<div class="post-metadata">

**Author:** ![deepakarora](https://avatars.discourse-cdn.com/v4/letter/d/c37758/32.png) [@deepakarora](https://developer.sailpoint.com/discuss/u/deepakarora)\
**Post date:** [August 5, 2025, 5:26pm UTC](https://developer.sailpoint.com/discuss/t/search-query-to-fetch-account-attributes/162396/9 "2025-08-05T17:26:42Z")

</div>

Hi,

You can apply this filter directly in API of getting account then you can store the account id in variable.

Thanks.

---

<div class="post-metadata">

**Author:** ![neeraj99](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/neeraj99/32/14001_2.png) [@neeraj99](https://developer.sailpoint.com/discuss/u/neeraj99)\
**Post date:** [August 6, 2025, 11:44am UTC](https://developer.sailpoint.com/discuss/t/search-query-to-fetch-account-attributes/162396/10 "2025-08-06T11:44:42Z")

</div>

> [@nidhipriya](#):
>
> $.hTTPRequest.body.accounts[?(@.sourceName==‘xyz’)].id

This expression will not work as the sailpoint defineVariable operator only stores string & the above expression will return the array.

If you still want the JSON Path expression use the below expression to get a accountID based on the source id from HTTP Request body:

_ **P.S This will also not work in define Variable but you will be able to see it being evaluated just not being stored** _

```auto
$.hTTPRequest.body[*].accounts[?(@.source.name=="xxxx" )].id

```

 ![image](https://global.discourse-cdn.com/sailpoint/original/3X/8/0/80641f85ed33f04f316cc71b062436cc08630c4e.png)

This will return the account ID for the respective source if it exists. You can use [Json Path Evaluator | SailPoint Developer Community](https://developer.sailpoint.com/tools/json-path-evaluator/) to verify the JSON Path.

---

<div class="post-metadata">

**Author:** ![rohitmisal45](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/rohitmisal45/32/34069_2.png) [@rohitmisal45](https://developer.sailpoint.com/discuss/u/rohitmisal45)\
**Post date:** [August 6, 2025, 9:35pm UTC](https://developer.sailpoint.com/discuss/t/search-query-to-fetch-account-attributes/162396/11 "2025-08-06T21:35:49Z")

</div>

Tried this query: `@accounts(source.name: "Source Name") AND @account(_exists_ samAccountname:*)`, but it didn’t work.  
I even modified it a bit, but still no results showed up.

---

<div class="post-metadata">

**Author:** ![nidhipriya](https://avatars.discourse-cdn.com/v4/letter/n/958977/32.png) [@nidhipriya](https://developer.sailpoint.com/discuss/u/nidhipriya)\
**Post date:** [August 7, 2025, 1:49pm UTC](https://developer.sailpoint.com/discuss/t/search-query-to-fetch-account-attributes/162396/12 "2025-08-07T13:49:19Z")

</div>

hi @Neeraj ,  
I tried with this expression as well in loopinput  
its not fetching accountid

---

<div class="post-metadata">

**Author:** ![vdivakar](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/vdivakar/32/14308_2.png) [@vdivakar](https://developer.sailpoint.com/discuss/u/vdivakar)\
**Post date:** [August 8, 2025, 11:08am UTC](https://developer.sailpoint.com/discuss/t/search-query-to-fetch-account-attributes/162396/13 "2025-08-08T11:08:27Z")

</div>

@nidhipriya the easiest way I can tell is 2 step process.

1. Map the AD source attribute to one of the identity attributes. Lets say DateFromAd.
2. Then in search query choose column DateFromAd from column chooser.

Let me know if you have any questions.  
Thank you,  
Vaibhav

---

<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 7, 2025, 11:08am UTC](https://developer.sailpoint.com/discuss/t/search-query-to-fetch-account-attributes/162396/14 "2025-10-07T11:08:27Z")

</div>

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