Hello,
Making a system for extracting the text from the body of an automated email.
I want to extract just specific values of strings from it, i have made this before, but right now I'm experiencing some trouble.
I would like to extract the text between the 'Assigned By:' and the comma (',')
Part of the text I would like to extract
I am using the following expression:
substring(body('Html_to_text'),add(lastIndexOf(body('Html_to_text'),'Assigned By: '),13),sub(indexOf(body('Html_to_text'),','),add(indexOf(body('html_to_text'),'Assigned By: '),13)))
And this returns the following error:
It's apparently not detecting the comma (',') value. I know that because I tested enterin '09/' value instead of ',' and it returned:
So the expression does work, it is receiving a correct parameters and so. It is just that it isn't detecting the comma value, how can I achieve this?
Thanks.
LG
Solved! Go to Solution.
Here is the full solution
https://github.com/rdorrani/Microsoft-Flow/blob/master/FetchstringfromSampletext_20190925204900.zip
This one fetches the line item and the word from that specific line item
Regards,
Reza Dorrani
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Use expression
Regards,
Reza Dorrani
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hey thanks for the reply
Didn't worked, copy pasted and assigned the expression to the value field; no value returned.
Weird, using my actual expression is there any solution? Another way of stating there is a comma character?
I tested this with exactly the same string as yours and it worked
Make sure the expression you updated is reflected in the flow- sometimes it does not update it
Email content is outputted correctly.
yeap, even I deleted the last exression and created a new one for making sure it was updated.
I really don't know what could be.
what is the data type of this variable?
can u try the same expression in a compose action
The variable is a String.
I tried:
It does not show anything:
After that I also tried to first compose the plain text of the email, the html to text output. then assigning the output to a variable called email text, then used the expression but as a parametter I supply the variable. Same result. Could it be that the email contain maybe too many characters?? Or lots of ',' and ':'?
How will it work - your html to text has many more strings and not just the string you mentioned when you first posted this message
Does the html to text output have new line characters in it?
Here is the full solution
https://github.com/rdorrani/Microsoft-Flow/blob/master/FetchstringfromSampletext_20190925204900.zip
This one fetches the line item and the word from that specific line item
Regards,
Reza Dorrani
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thanks for the help, I manage it through the following way:
I compose the whole string from assigned by until subject and assigned that output to a variable.
Then I splited that variable by a comma, and it worked.
I could done that with just one variable, but i don´t know how to pull the output from the compose actions 😛 But i do know how to pull the variables through 'variables()' .
Thanks.
Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!
Power Platform release plan for the 2021 release wave 1 describes all new features releasing from April through September 2021.
User | Count |
---|---|
89 | |
57 | |
41 | |
37 | |
29 |
User | Count |
---|---|
75 | |
66 | |
53 | |
47 | |
43 |