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

Community site session details

Session Id : nZ3bHSAN67Fo2tzMs3E1iA
Power Automate - Building Flows
Answered

Check if a string contains a wildcard phrase

Like (0) ShareShare
ReportReport
Posted on 2 Oct 2023 15:55:19 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 05 Oct 2023 at 09:59:37
    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
    45,324 Super User 2025 Season 2 on 02 Oct 2023 at 16:26:32
    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

Announcing our 2025 Season 2 Super Users!

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 2

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 2

Loading complete