# Update all users with a new rule?

**URL:** <https://community.auth0.com/t/update-all-users-with-a-new-rule/68133>\
**Category:** Get Help\
**Tags:** auth0\
**Created:** [August 18, 2021, 1:36pm UTC](https://community.auth0.com/t/update-all-users-with-a-new-rule/68133 "2021-08-18T13:36:32Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![seltar](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/seltar/32/12977_2.png) [@seltar](https://community.auth0.com/u/seltar)\
**Post date:** [August 18, 2021, 1:36pm UTC](https://community.auth0.com/t/update-all-users-with-a-new-rule/68133/1 "2021-08-18T13:36:32Z")

</div>

We have a property set on each Auth0 user object, but it’s not searchable since it’s outside the user\_metadata / app\_metadata objects.  
How can I run a rule on all our existing users to transfer the property into the app\_metadata object?

---

<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 18, 2021, 9:57pm UTC](https://community.auth0.com/t/update-all-users-with-a-new-rule/68133/3 "2021-08-18T21:57:31Z")

</div>

Hi @seltar,

Where is the property set?

---

<div class="post-metadata">

**Author:** ![seltar](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/seltar/32/12977_2.png) [@seltar](https://community.auth0.com/u/seltar)\
**Post date:** [August 19, 2021, 2:29pm UTC](https://community.auth0.com/t/update-all-users-with-a-new-rule/68133/4 "2021-08-19T14:29:51Z")

</div>

This is how it appears when I request a list of users from the api.

```auto
{
    "created_at": "create date",
    "dateofbirth": "some birthdate",
    "family_name": "Last name",
    "given_name": "First name",
    "identities": [
        {
            "provider": "oauth2",
            "access_token": "some token",
            "user_id": "some user id",
            "connection": "connection name",
            "isSocial": true
        }
    ],
    "name": "Full name",
    "nickname": "Full name",
    "picture": "url to picture",
    "ssn": "I want to copy this field",
    "sub": "some id",
    "updated_at": "update date",
    "user_id": "user id",
    "last_login": "login date",
    "last_ip": "login ip",
    "logins_count": 1,
    "app_metadata": {
        "userId": "internal user id",
        "roles": [
            "internal user role"
        ]
    }
}

```

So my goal is to copy the ‘ssn’ field over to the ‘app\_metadata’ field to make it searchable for all the existing and future users.

---

<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 19, 2021, 4:31pm UTC](https://community.auth0.com/t/update-all-users-with-a-new-rule/68133/5 "2021-08-19T16:31:42Z")

</div>

You could use a rule to update this attribute as your users log in, or you can use the management API to update all of the users at once.

---

<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 3, 2021, 4:32pm UTC](https://community.auth0.com/t/update-all-users-with-a-new-rule/68133/6 "2021-09-03T16:32:35Z")

</div>

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