cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MonteTT
Helper I
Helper I

How to remove various strings after the names in a list

Hi guys. Can you advise me how to remove various string after the name? I have name list with titles and meta-into, e.g.:
John Brown, PhD., UQ, 400
Jane Hopkins, PhD., WF , 500
Tom Silver, CSc. , XG, 300

I need ti display just names and titles, but I don't know how to do that.

1 ACCEPTED SOLUTION

Accepted Solutions
AmDev
Super User
Super User

Hi @MonteTT 

 

Slightly more complicated, but try this - you just need to amend the red to feed in your text

 

With({varwArray:Split(YourText,".")},Concat(FirstN(varwArray,CountRows(varwArray)-1),Result,".")& ".")

 

Note: this assumes you are always trimming after the last "." and keeping everything to the left, including the last "."

 

Hope this helps

View solution in original post

7 REPLIES 7
AmDev
Super User
Super User

Hi @MonteTT  

 

You can use this approach - note this is based on the consistent presence of your first "," being after the name.

 

Left(YourNameText, Find(",",YourNameText)-1)

 

Hope this helps

MonteTT
Helper I
Helper I

Hi @AmDev .

This snippet keep just name. Title after the name has been trimmed as well. I need trim rest of string after the second comma (including comma).

Apologies @MonteTT  - I missed that.

 

I see the titles all end with a "." - so try that in your formula instead:

 

Left(YourNameText, Find(".",YourNameText)-1

MonteTT
Helper I
Helper I

Sorry, @AmDev, I wrote too simplified example. A problem is that every person has multiple titles: before the name and after the name too.

prof. PhDr. John Brown, PhD., UD, 500
doc. RNDr. David Black, CSc.,XF,300

So there are multiple dots nad commas that I need to keep.

Output should looks like:

prof. PhDr. John Brown, PhD.
doc. RNDr. David Black, CSc.

AmDev
Super User
Super User

Hi @MonteTT 

 

Slightly more complicated, but try this - you just need to amend the red to feed in your text

 

With({varwArray:Split(YourText,".")},Concat(FirstN(varwArray,CountRows(varwArray)-1),Result,".")& ".")

 

Note: this assumes you are always trimming after the last "." and keeping everything to the left, including the last "."

 

Hope this helps

MonteTT
Helper I
Helper I

Works fine 🙂 Thank you very much @AmDev 👍

AmDev
Super User
Super User

Great stuff @MonteTT - glad you're sorted!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,345)