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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Extraction of a word f...
Power Automate
Answered

Extraction of a word from a sentence if it is include in a list of word

(0) ShareShare
ReportReport
Posted on by 41

Dear members,

 

Some actions generates a text variable %sentence% storing for instance "FCE - France - Marseille - vélodrome"

I try to look inside this sentence to find if it contains on of the town listed here "Paris, Marseille, Lyon, Dijon".
 
The result should be obtained even in case of mistake in the spelling so Marseil should send back Marseille. I assume that checking the first 4 characters of the words contained in %sentence% with the first 4 character of the town list would be sufficient.
 
I reached a result with the flow below but it does not allow any mistake in the spelling as it uses "find common list item".
 
Emmanuel9_0-1691594172521.png

 

Many thanks in advance

I have the same question (0)
  • Agnius Bartninkas Profile Picture
    Most Valuable Professional on at

    Well, if you want to check the first 4 characters, then only include that much in the list you check for. So, instead of using "Paris, Marseille, Lyon, Dijon", use "Pari, Mars, Lyon, Dijo" as the list.

    -------------------------------------------------------------------------
    If I have answered your question, please mark it as the preferred solution. If you like my response, please give it a Thumbs Up.

    I also provide paid consultancy and development services using Power Automate. If you're interested, DM me and we can discuss it.

  • Verified answer
    Emmanuel9 Profile Picture
    41 on at

    Finally I used a script to solve the issue.

     

    $sentence = "%EntityName%"
    $wordList = "Word List"
    $variableName = ""
    $sentence = [regex]::Escape($sentence)

    #Looking for a match using the 3 first characters
    foreach ($word in $wordList) {
        if ($sentence.ToLower().Contains($word.ToLower().Substring(0, 3))) {
            $variableName = $word.Substring(0, 3)
            #Write-Host "The sentence contain $word"
            break
        }
    }
    Write-output $word

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 276 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 169

#3
Haque Profile Picture

Haque 154

Last 30 days Overall leaderboard