# How to pull out specific values from Python Script output

**URL:** <https://developer.sailpoint.com/discuss/t/how-to-pull-out-specific-values-from-python-script-output/72011>\
**Category:** SHF Discussion and Questions\
**Tags:** python-sdk, identity-security-cloud\
**Created:** [July 11, 2024, 2:23pm UTC](https://developer.sailpoint.com/discuss/t/how-to-pull-out-specific-values-from-python-script-output/72011 "2024-07-11T14:23:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ScottTanselle](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/scotttanselle/32/10152_2.png) [@ScottTanselle](https://developer.sailpoint.com/discuss/u/ScottTanselle)\
**Post date:** [July 11, 2024, 2:23pm UTC](https://developer.sailpoint.com/discuss/t/how-to-pull-out-specific-values-from-python-script-output/72011/1 "2024-07-11T14:23:17Z")

</div>

Using the SailPoint python plugin v1.05. Here is my script I am running.

```auto
search = Search()
    search.indices = ['identities']
    search.query = {'query': '*'}
    search.sort = ['-name']
    identityCount = 0
    accountCount = 0
    workgroupCount = 0

    identities = Paginator.paginate_search(sailpoint.v3.SearchApi(api_client), search, 2, 2)
    for identity in identities:
        pprint(identity['name'])
        # print(identity)
        identityCount = identityCount + 1

    print("Total Identities: " + str(identityCount))

```

Here is a snippet of the output:  
`{'id': 'b5239ae9e6b5452898f667f9770de77b', 'name': 'smithk', 'displayName': 'smith', 'firstName': 'Karen', 'lastName': 'Smith', 'email': 'no-email', 'created': '2023-10-18T21:51:34.772Z', 'modified': '2024-06-14T14:46:36.560Z', 'inactive': False, 'protected': False, 'status': 'UNREGISTERED', 'employeeNumber': '11111', 'isManager': False, 'identityProfile': {'id': 'af64a436fa3c4ce5b036c415ca3fe66b', 'name': 'Userdatabase Dev'}, 'source': {'id': '0945e35866c04ccb72a9c42c69a21bf', 'name': 'Userdatabase Dev'}`

I know I can use `pprint(identity['name'])` to get the value of smithk. How would I format it so that I could pull out the ‘identityProfile’ value of Userdatabase Dev or whatever that value would be?

---

<div class="post-metadata">

**Author:** ![enistriminsait](https://avatars.discourse-cdn.com/v4/letter/e/58f4c7/32.png) [@enistriminsait](https://developer.sailpoint.com/discuss/u/enistriminsait)\
**Post date:** [July 11, 2024, 4:49pm UTC](https://developer.sailpoint.com/discuss/t/how-to-pull-out-specific-values-from-python-script-output/72011/2 "2024-07-11T16:49:04Z")

</div>

Hi @ScottTanselle,

try with identity[‘identityProfile’][‘name’]

---

<div class="post-metadata">

**Author:** ![ScottTanselle](https://sea1.discourse-cdn.com/sailpoint/discuss/user_avatar/developer.sailpoint.com/scotttanselle/32/10152_2.png) [@ScottTanselle](https://developer.sailpoint.com/discuss/u/ScottTanselle)\
**Post date:** [July 11, 2024, 5:12pm UTC](https://developer.sailpoint.com/discuss/t/how-to-pull-out-specific-values-from-python-script-output/72011/3 "2024-07-11T17:12:15Z")

</div>

> [@enistriminsait](#):
>
> identity[‘identityProfile’][‘name’]

Thank you Emanuele, that worked.

---

<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 9, 2024, 5:12pm UTC](https://developer.sailpoint.com/discuss/t/how-to-pull-out-specific-values-from-python-script-output/72011/4 "2024-09-09T17:12:21Z")

</div>

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