I have been assigned a urgent task to build a solution where in we will receive in sharepoint document library and then the workflow should pharse the data out of it and store it in list.
I have created a document library,done settings to receive email and have also put query xml in workflow and stored the email body in an multiline variable.but I am not able to generate its xpath through xpath builder as the email body contain many other data from email server and im not good with regular expression can anybody please help me out with this.. The data which I need to be pharsed out is Title,Last Name,First Name,email address,Phone number,city,Post code and message.you can find the xml which I got by query xml in attachment.
Solved! Go to Solution.
first of all, which 'fields' from the data content you provided are you interested in?
they seem to be listed there twice, once as a plain text and second time as a html table. but they do not fit in content.
second, it might be quite complex to parse this.
you can not apply XPath directly on this since it is not valid XML document. you might go with XPath if you were interested in data from html table. to get html table out of whole content would be quite easy with regular expresion.
still, building an XPath over the table will not be easy/straightforward, since it needs to traverse unclear number of levels to get to common parent of both label (eg. Last Name) and its value (eg. Subuar) and then to go down the tree from parent again unclear number of levels to the value. maybe somehow step by step with several actions, but I'm not sure, have never worked on something like this yet.
with regular expressions I would see it moreless the same. you would likely need one regular expression to address that common parent, then the other to get value.
what I'd affraid of the most is unclear content/structure in regard of formatting. that might cause that you get every mail with different structure (those mentioned unclear number of levels).
next thing which is not clear and which might complicate things further is whether single mail can contain several items (data of several people), and whether this would be possible identify somehow from html table at all.
would it be possible that you accepted just plain text mails?
or that mail body is already valid XML content/document?
I thought the same,and have used regular expression to retrieve the data from Email,till now it working fine,lets hope for the best.Thanks for your reply. :)