Post Closed
564
Views
8
Comments
Solved
Name split
Question

Hello everyone, I am getting trouble with separating user name. I store full user name in database, and i want to get only first name from it in expression. How should i do?


2018-12-09 19-13-19
Tiago Gomes
Solution

Hello Phone,

You got several ways to do this. I would suggest you to substr() the string since the first char to the index() where is the first " ". Other way is to use the String_Split and get the first value of the list. Other way to do it is with SQL using some functions and an advaced query!

Cheers!

UserImage.jpg
Ellakkiya

Phone wrote:

Hello everyone, I am getting trouble with separating user name. I store full user name in database, and i want to get only first name from it in expression. How should i do?


Hi Phone,

Do you have any delimiters in full username.

can you explain with more details? 


2019-10-21 07-27-24
Zaw Phone Thet

Ellakkiya Selvadurai wrote:

Phone wrote:

Hello everyone, I am getting trouble with separating user name. I store full user name in database, and i want to get only first name from it in expression. How should i do?


Hi Phone,

Do you have any delimiters in full username.

can you explain with more details? 


For example, the name is "Kyaw Naing Oo" and I want only "Kyaw"

UserImage.jpg
Ellakkiya

Phone wrote:

Ellakkiya Selvadurai wrote:

Phone wrote:

Hello everyone, I am getting trouble with separating user name. I store full user name in database, and i want to get only first name from it in expression. How should i do?


Hi Phone,

Do you have any delimiters in full username.

can you explain with more details? 


For example, the name is "Kyaw Naing Oo" and I want only "Kyaw"

Hi phone,

You can go with Tiago Gomes approach 

Use String_split action

Drag an assigment

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Hi Phone,

Like Tiago already said, you can use Substr + IndexOf, or alternatively, you could use String_Split (from the Text extension). However, depending on where a person comes from, there may be no easy way to determine what part is the first name, and what part the last (take e.g. a Dutch name like "Harm Jan de Vries", where it splits in the middle (and, oddly enough, a seperate last name should be spelled with a capital ("De Vries"), but not if initials or first name come before).

2019-06-15 21-39-22
Afonso Carvalho
 
MVP

Hi,

You can use String_Split from the Text extension, and select the first result of the output list.

You can use the space (" ") as your delimiter.

2022-02-07 08-52-30
Pranav Pandey

Hi Phone,

You can use the below method to get the first name


SyntaxEditor Code Snippet

Substr(NAME,0,Index(NAME," "))

you find the position of the space and use substr function to fetch the first word.


Hope this will helpful.

:)

2020-09-15 13-07-23
Kilian Hekhuis
 
MVP

Ok guys, I'm going to close this topic. People keep answering the same over and over again, that's not very useful. To all: please read the previous replies first, before replying!