cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Help with Parsing

Hey All!

 

I'm currently working on a multi level approval workflow where we are parsing out an email and taking the information to passthrough to a quote approval request formatted email to get approved. Below you will find the structure of the email. My biggest hiccup currently is related to the link that follows "Please click to open quote attachment". A requestor can add any number of file types for the customer to review as supporting documentation for the quote. Because the last part of the url will change based on the file name, I find myself at a loss as to the best way to parse it out without throwing an error. Additionally, if the user does not attached supporting documents, that verbiage and url are not there in the email at all. This is the current expression I have, but I know that it will eventually throw an error. the replace '-' with '' is to accomodate the posibility of a signature line that's embedded into our email when we send. Which also may or may not happen. Any recommendations? I have put "x" for confidentiality but the character count is accurate. 

 

emailtobeparsed.PNG

 

Expression to parse out URL

if(contains(substring(body('Html_to_text'),indexOf(body('Html_to_text'),'https'),add(sub(add(lastIndexOf(body('Html_to_text'),'QuoteDocs'),10),indexOf(body('Html_to_text'),'https')),50)),'-'),trim(replace(substring(body('Html_to_text'),indexOf(body('Html_to_text'),'https'),add(sub(add(lastIndexOf(body('Html_to_text'),'QuoteDocs'),10),indexOf(body('Html_to_text'),'https')),50)),'-','')),trim(substring(body('Html_to_text'),indexOf(body('Html_to_text'),'https'),add(sub(add(lastIndexOf(body('Html_to_text'),'QuoteDocs'),10),indexOf(body('Html_to_text'),'https')),50))))

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Help with Parsing

 

Hi @soylaunica ,

 

Please try to use the following expression to get the URL.

I did a test on my side and used a similar email body.

trim(last(split(body('Html_to_text'),'Please click to open quote attachment')))

Image reference:

54.PNG

55.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Community Support
Community Support

Re: Help with Parsing

 

Hi @soylaunica ,

 

Please try to use the following expression to get the URL.

I did a test on my side and used a similar email body.

trim(last(split(body('Html_to_text'),'Please click to open quote attachment')))

Image reference:

54.PNG

55.PNG

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helper II
Helper II

Re: Help with Parsing

While I much prefer this method, it still doesn't account for the signature. Sometimes there is a signature in the email and therefore this method contains the signature in the bottom. Is there maybe a way I can say up to however many characters without it erroring out? What I'm thinking is after the QuoteDocs/ the filename up to let's say 50 characters, then trim.

 

 parse result.png

Highlighted
Community Support
Community Support

Re: Help with Parsing

 

Hi @soylaunica ,

 

Does the signature you mentioned have any characteristics?

 

If there is, or fixed content, we can also separate it.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Users online (10,393)