cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lasher18
Regular Visitor

Split string by delimiter

Hi, I would like to split a string by a delimiter in order to get an email address to send some stuff attached. 

The title of files are like: example@email.com#120_2.pdf

I want to extract the text before "#"

Here's the flow I have so far:

 

em.PNG

2 ACCEPTED SOLUTIONS

Accepted Solutions
eric-cheng
Solution Sage
Solution Sage

Hi @lasher18 ,

 

I cant see your expression but you are spliting the variable you are initialising which would be empty.  Are you sure you are referencing the correct variable in the expression?  Assuming there is an actual value and its not null.

 

Example below is using @first(split(variables('MyStr'),'#'))

 

Screenshot_20210921-013305_Chrome.jpg

 

Screenshot_20210921-013323_Chrome.jpg

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

View solution in original post

eric-cheng
Solution Sage
Solution Sage

Hi @lasher18 ,

 

Same formula but replace first with last()

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

View solution in original post

5 REPLIES 5
eric-cheng
Solution Sage
Solution Sage

Hi @lasher18 

 

Try

 

@first(split('example@email.com#120_2.pdf','#'))

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

Ir returns an error. "The parameter 'To' cannot be empty".

I put:  first(split(variables('Textosplit'),'#')) in 'To' when sending the email

eric-cheng
Solution Sage
Solution Sage

Hi @lasher18 ,

 

I cant see your expression but you are spliting the variable you are initialising which would be empty.  Are you sure you are referencing the correct variable in the expression?  Assuming there is an actual value and its not null.

 

Example below is using @first(split(variables('MyStr'),'#'))

 

Screenshot_20210921-013305_Chrome.jpg

 

Screenshot_20210921-013323_Chrome.jpg

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

View solution in original post

lasher18
Regular Visitor

Thanks! It worked. Just one more thing please. How can I do the same for the second part of the string? The one after "#"

eric-cheng
Solution Sage
Solution Sage

Hi @lasher18 ,

 

Same formula but replace first with last()

 

--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up

Connect on LinkedIn

View solution in original post

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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.

Top Solution Authors
Users online (2,506)