web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Split Text based on CA...
Power Automate
Unanswered

Split Text based on CAPITALISED words OR split text based on number of comma's (i.e. if 1 comma do X if 2 comma's do Y etc)

(0) ShareShare
ReportReport
Posted on by 38

Hi all!

 

I am hoping someone can help me figure out this issue.  I want to be able to extract (split) text (event subject) that could look like any of the below: 

EXMAPLE 1: BLOGGS, Joe (Meeting - Office) 

EXMAPLE 2: BLOGGS, Joe, DOE, Jane (Meeting - Offsite)

EXMAPLE 3: SMITH, Timothy John, PHILLIP, Fairmont, GRACE Sally-Louise (Monthly Update - Richmond Office)

 

The results I ultimately want are:

function1: 

EXMAPLE 1: BLOGGS 

EXMAPLE 2: BLOGGS, DOE

EXMAPLE 3: SMITH, PHILLIP, GRACE 

function 2: 

EXMAPLE 1: Joe

EXMAPLE 2: Joe, Jane 

EXMAPLE 3: Timothy, Fairmont, Sally-Louise

 

I need the last name and first name in separate functions because they are used separately later on in the flow. 

 

Currently, I have a function that works for EXAMPLE 1 - 

Compose: split(triggerOutputs()?['body/subject'], ' ')[0]
which results in:    BLOGGS,
Compose: split(outputs('SURNAME_(with_comma)'), ',')[0]
which leaves me with:    BLOGGS
 
This works perfectly where there is only 1 name in the subject (as in EXAMPLE 1) .  However I can't figure out how to extract this if there is more than 1 name.
 
Ultimately my question is - is there a way to extract only the ENTIRELY capitalized words? and/or is there a way to extract the first word immediately after a comma (even where there are multiple commas, like in EXAMPLES 2 and 3) ? 
 
Categories:
I have the same question (0)
  • StillLearning_ Profile Picture
    38 on at

    Is there a way to do this without additional programs? 

  • Matthy79 Profile Picture
    4,180 Super User 2024 Season 1 on at

    Is it a typo that there is no comma between GRACE and Sally-Louise in Sample 3 or could this happen all the time? Could there also be double names with space that should be together? Is "(" always the sign to end up searching for names?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 519 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 296 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard