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
Seems simple, sometimes when doing this, I dont see the wood from the trees!
It has worked. Thanks
Heshan
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
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492