# EditUser, firstname and lastname

**URL:** <https://forum.inductiveautomation.com/t/edituser-firstname-and-lastname/45485>\
**Category:** Ignition\
**Created:** [April 12, 2021, 2:18pm UTC](https://forum.inductiveautomation.com/t/edituser-firstname-and-lastname/45485 "2021-04-12T14:18:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vipo](https://avatars.discourse-cdn.com/v4/letter/v/eada6e/32.png) [@vipo](https://forum.inductiveautomation.com/u/vipo)\
**Post date:** [April 12, 2021, 2:18pm UTC](https://forum.inductiveautomation.com/t/edituser-firstname-and-lastname/45485/1 "2021-04-12T14:18:24Z")

</div>

All the information I find on EditUser are only using ContactInfo…

How do you edit the username, firstname and lastname ?

regards  
VP

---

<div class="post-metadata">

**Author:** ![matthew.ayre](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/matthew.ayre/32/19499_2.png) [@matthew.ayre](https://forum.inductiveautomation.com/u/matthew.ayre)\
**Post date:** [April 12, 2021, 2:36pm UTC](https://forum.inductiveautomation.com/t/edituser-firstname-and-lastname/45485/2 "2021-04-12T14:36:28Z")

</div>

Hi @vipo, you can do it like this:

```auto
user = system.user.getUser('default', un)
user.set('firstName', fname)
user.set('lastName', lname)
err = system.user.editUser('default', user).getErrors()

```

Admittedly the docs for editUser are a bit lacking. I found the examples given in [getNewUser](https://docs.inductiveautomation.com/display/DOC81/system.user.getNewUser) more useful. The second example shows how to use the getNewUser system function and pass in the information to create the new user. Editing a user is similar, except you will be calling getUser and editUser.

---

<div class="post-metadata">

**Author:** ![vipo](https://avatars.discourse-cdn.com/v4/letter/v/eada6e/32.png) [@vipo](https://forum.inductiveautomation.com/u/vipo)\
**Post date:** [April 12, 2021, 3:11pm UTC](https://forum.inductiveautomation.com/t/edituser-firstname-and-lastname/45485/3 "2021-04-12T15:11:18Z")

</div>

@matthew.ayre thank you, I’ve been trying this several times… turned out to be a race condition for fetching the username.  
Thanks.

---

<div class="post-metadata">

**Author:** ![liam1](https://avatars.discourse-cdn.com/v4/letter/l/e68b1a/32.png) [@liam1](https://forum.inductiveautomation.com/u/liam1)\
**Post date:** [March 4, 2022, 11:48am UTC](https://forum.inductiveautomation.com/t/edituser-firstname-and-lastname/45485/4 "2022-03-04T11:48:21Z")

</div>

Does the user.set() method for first and last name work when using system.user.getNewUser()?

---

<div class="post-metadata">

**Author:** ![dkhayes117](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/dkhayes117/32/68344_2.png) [@dkhayes117](https://forum.inductiveautomation.com/u/dkhayes117)\
**Post date:** [March 4, 2022, 1:19pm UTC](https://forum.inductiveautomation.com/t/edituser-firstname-and-lastname/45485/5 "2022-03-04T13:19:26Z")

</div>

Yes it does. Check out the user manual for more details and code snippets.  
[system.user.getNewUser - Ignition User Manual 8.1 - Ignition Documentation (inductiveautomation.com)](https://docs.inductiveautomation.com/display/DOC81/system.user.getNewUser)
