# While Updating a User, their Display Name Changes

**URL:** <https://community.auth0.com/t/while-updating-a-user-their-display-name-changes/114335>\
**Category:** Get Help\
**Tags:** users, management-api\
**Created:** [August 23, 2023, 1:29pm UTC](https://community.auth0.com/t/while-updating-a-user-their-display-name-changes/114335 "2023-08-23T13:29:31Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![carl.t](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@carl.t](https://community.auth0.com/u/carl.t)\
**Post date:** [August 23, 2023, 1:29pm UTC](https://community.auth0.com/t/while-updating-a-user-their-display-name-changes/114335/1 "2023-08-23T13:29:31Z")

</div>

When doing an update ([users/patch-users-by-id](https://auth0.com/docs/api/management/v2/users/patch-users-by-id)) on a user, updating their phone number for example, the display name on auth0 for that user changes from their email, to their nickname.

Any reason for this? Can we control this in anyway?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [August 23, 2023, 6:42pm UTC](https://community.auth0.com/t/while-updating-a-user-their-display-name-changes/114335/3 "2023-08-23T18:42:28Z")

</div>

Hi @carl.t.

It looks like you do not have a Passwordless SMS connection. Looking further, I noticed your users have their phone numbers saved to their user\_metadata.

When updating the user’s phone number in the user\_metadata, it should not alter the user’s display name or change their email to their nickname.

If this is happening, you could workaround by updating the user with the `name` or `email` value of the preferred value.

I hope this helps!

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![carl.t](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@carl.t](https://community.auth0.com/u/carl.t)\
**Post date:** [August 24, 2023, 8:21am UTC](https://community.auth0.com/t/while-updating-a-user-their-display-name-changes/114335/4 "2023-08-24T08:21:53Z")

</div>

@rueben.tiow Thanks for the response.

Any ideas WHY this might be happening?

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [August 24, 2023, 4:39pm UTC](https://community.auth0.com/t/while-updating-a-user-their-display-name-changes/114335/5 "2023-08-24T16:39:21Z")

</div>

Hi @carl.t,

Thanks for following up.

I do not know why this is happening since it should not be happening. However, I suspect it might involve the request made to the Management API’s Update a user endpoint.

If possible, could you please share the request you made to update a user?

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![carl.t](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@carl.t](https://community.auth0.com/u/carl.t)\
**Post date:** [August 28, 2023, 10:22am UTC](https://community.auth0.com/t/while-updating-a-user-their-display-name-changes/114335/6 "2023-08-28T10:22:11Z")

</div>

Hi @rueben.tiow,

An example of our request below:

```auto
{
	"client_id": "s6ituTn1vcEEQa2d0DWO0Kxe8UrBT85P",
	"name": "solushome230710204520@sttesting.net",
	"verify_phone_number": false,
	"email": "solushome230710204520@sttesting.net",
	"user_metadata": {
		"phone_number": "0877777777"
	},
	"app_metadata": null,
	"connection": "XXXXXX",
	"verify_email": true
}

```

This would be an example of adding a phone number for a user.

Using endpoint PATCH /users/{id}

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [August 28, 2023, 5:10pm UTC](https://community.auth0.com/t/while-updating-a-user-their-display-name-changes/114335/7 "2023-08-28T17:10:28Z")

</div>

Hi @carl.t,

Thanks for following up.

I have just tested your sample body to update a user and did not encounter the same issues you observed.

Instead, I was able to successfully update a user, and the `name` and `email` properties match the ones being passed in the request.

See below:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/c/e/ce6a5ccec2ce9e26edcd73ebc9153f3d7ac647f9.png)

With that, I am confident that your request **should not** update the `name` and `email` properties.

Thanks,  
Rueben

---

<div class="post-metadata">

**Author:** ![carl.t](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@carl.t](https://community.auth0.com/u/carl.t)\
**Post date:** [September 1, 2023, 1:58pm UTC](https://community.auth0.com/t/while-updating-a-user-their-display-name-changes/114335/8 "2023-09-01T13:58:56Z")

</div>

@rueben.tiow thanks for the response. After testing the api call separately, i too am confident that that is not the issue. It looks like the issue occurs when using the front end to evoke this api call. Not sure where exactly as still investigating, but what i am talking about is explained below:

This shows full email as name:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/b/c/bc7066f803332592db9133da83516b6ff177ada7.png)

After update, it changes to below, even though we only update the phone number:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/f/d/fdc89054c7055d12ed3279260bfaa09e401a9953.png)

---

<div class="post-metadata">

**Author:** ![carl.t](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@carl.t](https://community.auth0.com/u/carl.t)\
**Post date:** [September 5, 2023, 10:53am UTC](https://community.auth0.com/t/while-updating-a-user-their-display-name-changes/114335/9 "2023-09-05T10:53:12Z")

</div>

The issue appears to be resolved. We were passing null for email when only updating the phone number, and mapping that null to “Name”. This caused the name to be null, and i suspect if name is null, it falls back on to the “Nickname” to display.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [September 5, 2023, 4:18pm UTC](https://community.auth0.com/t/while-updating-a-user-their-display-name-changes/114335/10 "2023-09-05T16:18:06Z")

</div>

HI @carl.t,

Thanks for following up.

I’m glad you were able to identify and resolve the issue, which involved passing a value to the “Name” attribute.

Please let us know if you have any additional questions. We’d be happy to help!

Thanks,  
Rueben

---

<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 19, 2023, 4:18pm UTC](https://community.auth0.com/t/while-updating-a-user-their-display-name-changes/114335/11 "2023-09-19T16:18:43Z")

</div>

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