Hi all, I'm having some trouble with a flow and hoping to get some input.
What I want to achieve is fairly simple. When a certain email arrives, it saves the whole email into a specific SharePoint folder. But what I want to do, is with the naming of the file, I want to extract some information from the body of the email and save this in the file name. It just doesn't seem to be working. So far my flow looks like this:
1. When a new email arrives - recipient in there as well as a filter by the word 'Confirmation' in the subject line
2. Condition action - filter the work Confirmation in the subject - if yes, goes to step 3
3. This is where I run into trouble because I tried just saving the file, but in order to name the file correctly I have to extract the data I need from the email body. I've followed some instructions and used a HTML to text action which does what it says, but when I do a compose action after this to get the information it's failing.
4. So this step is 'Compose' to extract the first peice of information which is the booking reference number. The second compose is the 'Title' thats in the body.
I'm getting the following error:
Unable to process template language expressions in action 'Compose_-_reference' inputs at line '0' and column '0': 'The template language function 'indexOf' expects two parameters: the string as the first parameter, the value to find the index of as the second parameter. The function was invoked with '3' parameter(s). Please see https://aka.ms/logicexpressions#indexof for usage details.'.
Below is the outputs from the HTML to text action: (i've replaced some confidential information with ***'s
"body": "********* Meeting Room Booking System (Do Not Reply)\n\nBooking Details\n\n \n\nBooking Reference:\n\n1137009 [https://mqb.*******-app.com.**/dwsapps-v2/ghw?meetingKey=1137009]\n\nTitle:\n\n********* | *** meeting\n\nStatus:\n\nBooked\n\nRoom:\n\n***\n\nDate:\n\n15/01/2025\n\nTime:\n\n11:00-12:00\n\nBooked for:\n\n******, ******\n\nBooked by:\n\n******, Stephanie\n\nType:\n\nExternal-Room Only\n\nAttendees:\n\n5\n\nLayout:\n\n*Standard*\n\nState:\n\nConfirmed-External\n\nCost Code:\n\n****************\n\nSite:\n\nLONDON - ** ********** Street\n\n \n\nService Item\n\nTime\n\nQuantity\n\nCost\n\nNotes\n\nApproval Status\n\nWater Complimentary\n\n11:00\n\n5\n\n0.00\n\nPre-approved\n\n
}
Basically, I need to extract the booking reference number 1137009 and the meeting title (in stars). If I can extract them as separate bits of data, I can then use them as part of the title for my saved file. Whats the best way to tackle this? I've used Chat GPT and I'm just going around in circles. Thanks!
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.