cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ninjaryder1st
Helper III
Helper III

Separating a Display Name that appears as a String without commas.

Any idea if I can use a data tool to separate or split the "display name" content into 2, and use only the first name.  

For example:  I would like to use first name only and separate the "displayname":  "bob smith"  to only "bob" and use "bob" later on in the flow with a dynamic content component.  

ninjaryder1st_0-1616630357551.png

 

6 REPLIES 6
Expiscornovus
Super User II
Super User II

Hi @ninjaryder1st,

 

Yes, you should be able to use a split function and use the space character for the split. Use the [0] index position to get the first part.

 

Below is an example in a couple of compose actions. 

split(outputs('Compose'), ' ')[0]

 

split_onspace.png

Mira_Ghaly
Dual Super User II
Dual Super User II

@ninjaryder1st 

Did you try to split by space

split(displayName,' ')[0]

 

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Thanks, I did learn about split expressions, but my issue is that when I pull out Display Name for "compose" its places an "apply to each" function for DisplayName, and I understand that apply to each cannot be used for Initialize Variable commands.   

 

ninjaryder1st_0-1616631370120.png

 

and composing w/ split expression yields this, w/o a name : 

 

ninjaryder1st_1-1616631506224.png

 

Ok, I forgot the Compose 1 before the Compose 2 with Split expression.  That works and I've split the name, but its not allowing me to recover the first name output from the split so I can place it later in the flow under HTML format for "send and email (V2)"..

ninjaryder1st_2-1616632221245.png

ninjaryder1st_3-1616632349365.png

 

Mira_Ghaly
Dual Super User II
Dual Super User II

@ninjaryder1st can you add screens how your flow is structured?

If this post helps you with your problem, please mark your as Accepted solution.If you like my response, please give it a Thumbs Up.

Blog: here

Hi @Mira_Ghaly ,

 

Sure!  

ninjaryder1st_0-1616677954028.png

ninjaryder1st_1-1616677999143.png

ninjaryder1st_2-1616678030817.png

 

 

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Top Solution Authors
Users online (1,165)