# Adding Roles from the Authorization Core to each user's raw JSON app\_metadata

**URL:** <https://community.auth0.com/t/adding-roles-from-the-authorization-core-to-each-users-raw-json-app-metadata/48458>\
**Category:** Get Help\
**Tags:** authorization-core, roles\
**Created:** [August 21, 2020, 7:56pm UTC](https://community.auth0.com/t/adding-roles-from-the-authorization-core-to-each-users-raw-json-app-metadata/48458 "2020-08-21T19:56:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jewellry](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jewellry/32/14566_2.png) [@jewellry](https://community.auth0.com/u/jewellry)\
**Post date:** [August 21, 2020, 7:56pm UTC](https://community.auth0.com/t/adding-roles-from-the-authorization-core-to-each-users-raw-json-app-metadata/48458/1 "2020-08-21T19:56:25Z")

</div>

Hello, i’ve set up an administrator role in my app and I’d like to be able to search for a user based on their roles since the main dashboard does not filter by roles.

I have the search functionality working and I’m able to search by anything within the user’s metadata. Although, I noticed all the roles are empty strings even though I have 5 designated Roles on the “Authorization Core”.

 ![Screen Shot 2020-08-21 at 3.52.26 PM](https://global.discourse-cdn.com/auth0/original/3X/f/9/f91e2c420505ffc22467510148a290276a9f5aa0.png)

Is there a way to automate this so that Core Roles will populate into user metadata?

Thanks, Ryan

---

<div class="post-metadata">

**Author:** ![dan.woda](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/dan.woda/32/18340_2.png) [@dan.woda](https://community.auth0.com/u/dan.woda)\
**Post date:** [August 31, 2020, 5:49pm UTC](https://community.auth0.com/t/adding-roles-from-the-authorization-core-to-each-users-raw-json-app-metadata/48458/3 "2020-08-31T17:49:17Z")

</div>

Hi @jewellry,

You can automate this action with a [log stream](https://auth0.com/docs/logs/export-log-events-with-log-streaming).

Any time a ` "type": "sapi", "description": "Assign roles to a user"` log comes through, you could make a call to the management API to update the user’s app\_metadata.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [September 15, 2020, 5:49pm UTC](https://community.auth0.com/t/adding-roles-from-the-authorization-core-to-each-users-raw-json-app-metadata/48458/4 "2020-09-15T17:49:21Z")

</div>

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