# How to select first name from user name column

**URL:** https://community.glideapps.com/t/how-to-select-first-name-from-user-name-column/57409
**Category:** Ask for Help
**Created:** [February 2, 2023, 10:49am UTC](https://community.glideapps.com/t/how-to-select-first-name-from-user-name-column/57409 "2023-02-02T10:49:52Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![paul3463](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@paul3463](https://community.glideapps.com/u/paul3463)
#### Post date: [February 2, 2023, 10:49am UTC](https://community.glideapps.com/t/how-to-select-first-name-from-user-name-column/57409/1 "2023-02-02T10:49:52Z")

</div>

Hi:

I want to select the first name from the list if users so that I can create a greeting like: “Hi John” - but the user column includes second name too. I am sure it must be easy - but not sure how to do it.

I would appreciate your help.

Thanks

Paul

---

<div class="post-metadata">

### Author: ![glide](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/glide/32/53398_2.png) [@glide](https://community.glideapps.com/u/glide)
#### Post date: [February 2, 2023, 10:49am UTC](https://community.glideapps.com/t/how-to-select-first-name-from-user-name-column/57409/2 "2023-02-02T10:49:57Z")

</div>

_This is an experimental reply from a bot. Please like it if it’s correct._

You can use the Split Text action to separate the first and last name from the user name column. This action will split the text into two parts, based on a separator you specify. You can then use the first part of the split text as the first name. Learn more about the Split Text action here. [Glide • User profile columns](https://www.glideapps.com/docs/reference/values/user-profile-columns)

---

<div class="post-metadata">

### Author: ![Robert\_Petitto](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/robert_petitto/32/25193_2.png) [@Robert\_Petitto](https://community.glideapps.com/u/Robert_Petitto)
#### Post date: [February 2, 2023, 11:32am UTC](https://community.glideapps.com/t/how-to-select-first-name-from-user-name-column/57409/3 "2023-02-02T11:32:11Z")

</div>

The answer above is half right. Split the Full Name at the space and then use a single value column to get the first value of the split text column (which would be the first name).

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [February 2, 2023, 12:14pm UTC](https://community.glideapps.com/t/how-to-select-first-name-from-user-name-column/57409/4 "2023-02-02T12:14:58Z")

</div>

For a single column solution, you can use the [Extract Matching Text](https://www.glideapps.com/plugins/regex) plugin with the following regular expression:

```auto
^(^[\S]+)

```

 ![Screen Shot 2023-02-02 at 8.05.01 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/9/e/9eff78b8bc4efee6423663127e951011dee671a8.png)

Or you could use a JavaScript column with the following code:

```auto
return p1.split(' ')[0];

```

 ![Screen Shot 2023-02-02 at 8.11.03 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/3/d3d4c18760c05e23eaca91e9b664be3a8f2a4d03.png)

---

<div class="post-metadata">

### Author: ![paul3463](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@paul3463](https://community.glideapps.com/u/paul3463)
#### Post date: [February 3, 2023, 11:13am UTC](https://community.glideapps.com/t/how-to-select-first-name-from-user-name-column/57409/5 "2023-02-03T11:13:16Z")

</div>

Thanks. I’ve done this and it works. The first time I tried the single value was the first name of the first person in the user list - then repeated throughout the column. I tried again and it has produced a list of different names (even though it is the single value column). I don’t really understand the logic - but it is working. So thanks.

---

<div class="post-metadata">

### Author: ![paul3463](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@paul3463](https://community.glideapps.com/u/paul3463)
#### Post date: [February 3, 2023, 11:15am UTC](https://community.glideapps.com/t/how-to-select-first-name-from-user-name-column/57409/6 "2023-02-03T11:15:49Z")

</div>

Thanks. I’ve tried both the split text method and your JavaScript suggestion - which works well. Unfortunately I don’t know anything about JavaScript - so cannot understand WHY or HOW it works - but the fact that it does very neatly is cool. Thanks

---

<div class="post-metadata">

### Author: ![Darren\_Murphy](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/darren_murphy/32/47326_2.png) [@Darren\_Murphy](https://community.glideapps.com/u/Darren_Murphy)
#### Post date: [February 3, 2023, 11:31am UTC](https://community.glideapps.com/t/how-to-select-first-name-from-user-name-column/57409/7 "2023-02-03T11:31:21Z")

</div>

It works in a very similar way as the Split Text + Single Value method that Bob gave you.

The JavaScript `split()` function accepts an input parameter, and will attempt to split it using the separator that you provide - the quoted bit inside the parentheses, in this case a single space.

As with the Split Text column, the JavaScript `split()` function will return an array. In this case, we only want the first element of the array, and the way we access that is by tagging the `[0]` on the end.

So it basically does exactly the same as Split Text + Single Value → First, but combines them both into a single step.

Or… we could just ask ChatGPT to explain it 😉

 ![Screen Shot 2023-02-03 at 7.33.41 PM](https://us1.discourse-cdn.com/flex002/uploads/glideapps/original/3X/d/7/d7586b3bbd262e34ad13a15baaa54c7ccadb1475.jpeg)

---

<div class="post-metadata">

### Author: ![paul3463](https://avatars.discourse-cdn.com/v4/letter/p/8c91f0/32.png) [@paul3463](https://community.glideapps.com/u/paul3463)
#### Post date: [February 17, 2023, 9:27am UTC](https://community.glideapps.com/t/how-to-select-first-name-from-user-name-column/57409/8 "2023-02-17T09:27:53Z")

</div>

Hi:

Sorry for not replying - for some reason your message got lost in my inbox. The ChatGPT explanation is amazing - I am really impressed by it. So clear.

Thanks for your help.

Paul
