Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Split and extract words from a sentence

(0) ShareShare
ReportReport
Posted on by 70

Hi,

 I have a text sentence called: This is the users FirstName LastName. Now I want extract the Last two words from the sentence and store them in variables, say varFirstName and varLastName. The sentence would keep changing but for any input text/sentence, I want to get the last two words and store them as separate variables. Using Last(Split()) function as power fx in automate, I was able to get the Last word, but where I am struck is at, to get the last before word.

 

Please could anyone help me on this?

 

Thanks.

  • Chriddle Profile Picture
    Chriddle 7,336 on at
    Re: Split and extract words from a sentence
    reverse(
    	take(
    		reverse(
    			split(
    				'This is the users FirstName LastName.',
    				' '
    			)
    		),
    		2
    	)
    )

     

    Chriddle_0-1709806592670.png

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,508

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,839

Leaderboard