Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Substring First name from Full name using advance expression

Avatar

Level 3

Hi all,

I'm trying to extract first name from full name using Substring(@fullName,1,Charindex(" ",@fullName))

However, it does not work. My Charindex returns 0.  Can someone help me with this?

Thanks in advance!

1 Accepted Solution

Avatar

Correct answer by
Level 3

Thanks so much Anita.

I'm trying to substring only when there's a space. However, I got a case function error for the expression below. Can you help?

Thanks again!

Case(When(@fullName LIKE ' ', Substring(@fullName,0,Charindex(@fullName, " ")), Else(@fullName)))

View solution in original post

0 Replies

Avatar

Community Advisor

Hi Michelle,

The index of Substring starts with "0".

Try below expression. This should work.

Substring(@fullName,0,Charindex(@fullName," "))

Thanks,

Anita

Avatar

Correct answer by
Level 3

Thanks so much Anita.

I'm trying to substring only when there's a space. However, I got a case function error for the expression below. Can you help?

Thanks again!

Case(When(@fullName LIKE ' ', Substring(@fullName,0,Charindex(@fullName, " ")), Else(@fullName)))