Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Check if a string contains a wildcard phrase

(0) ShareShare
ReportReport
Posted on by 115

HI there

 

I have built a flow interrogating an excel sheet / table.

From a cell containing a large report which is text containing letters, symbols and numbers, I am able to extract data. Each question answer is placed on a row in the spreadsheet. The largest block of text is in one column along the row.

 

I am able to use indexof and substring to extract answers. There is a template that is for the report so the answers should be between known phrases, words and sentences which are part of the template. 

 

For example

The report states

TECHNIQUE: PROSPECTIVE

DOSE: HIGH

 

So I can use indexof to find where "TECHNIQUE:-" ends and where the word "DOSE" starts and take a substring of the bit in between (in this case "PROSPECTIVE") which is what I need to ultimately update a sharepoint list.

 

However, users sometimes do not give single number answers.

 

One of the report headings is 

"HEART RATE:     bpm". Users should enter ONE heart rate value but sometimes put "52-55"

(e.g. HEART RATE: 52-55 bpm)

 

I want one number only.

 

I dont want to have to go through the sheet of 150 or so entries changing the HEART rate values to one or the other or average.

 

Is there a way to get powerautomate to find the xx-yy bpm phrase and then get it to pick either xx or yy to get one number out?

 

I could do it in excel first, extract the data using FIND and MID but that takes time.

 

Heshan

  • heshan_pandit Profile Picture
    115 on at
    Re: Check if a string contains a wildcard phrase

    Seems simple, sometimes when doing this, I dont see the wood from the trees!

     

    It has worked. Thanks

     

     

    Heshan

  • Verified answer
    Michael E. Gernaey Profile Picture
    43,442 Super User 2025 Season 1 on at
    Re: Check if a string contains a wildcard phrase

    Hi,

     

    Sorry you typed a lot of stuff so I am confused at what you need for sure.

    You said you know how to use Indexof, so you should be able to find the number of the number-number

     

    In which case you would add a Compose action like this.

     

    Assuming you did a Compose action to get the IndexOf (the substring respectively).

    Where if there is a - in the string you find in your IndexOf Compose, it will split it and give you the bottom one, or it just returns back the number from your previous IndexOf compose.

     

    You could also do [1] if you wanted the higher number

    contains(outputofothercompose,'-', split[outputofothercompose][0], outputofothercompose)

     
    Cheers
    If you like my answer, please Mark it as Resolved, and give it a thumbs up, so it can help others
    Thank You
    Michael Gernaey MCT | MCSE | MCP | Self-Contractor| Ex-Microsoft
    https://gernaeysoftware.com
    LinkedIn: https://www.linkedin.com/in/michaelgernaey

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 566 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 516 Super User 2025 Season 1

#3
stampcoin Profile Picture

stampcoin 492