Skip to main content
Community site session details

Community site session details

Session Id : Gqzp3w+b2pz2itpmoXK+dO
Power Automate - Building Flows
Unanswered

Outlook 365 XML Attachment to SQL Server

Like (0) ShareShare
ReportReport
Posted on 23 Mar 2021 09:42:45 by

Hi 

I'm hoping someone here has tried to do this from an Outlook365 mailbox.

I get emails from a parts supplier with 2 attachments: a pdf and an xml document.

With our old Mailparser setup we extracted the XML into a string and stored it in a nvarchar(max) column on SQL server. 

I'd like to replicate this process in Flow. So far I can process new emails, conditionally grab the XML attachment and send either an MS Graph object or a binary content and put that in the table (in a varbinary column).

As far as I can tell I cannot find a method to merely read the text of the XML file attachment and dump that to a column. 

I don't wish to parse the XML in a more detailed fashion in the Flow itself as this process is thoroughly setup on SQL Server plus we do need to keep the XML string for future queries.

What I have so far is:

  • Login to the mail box, process new emails as they land
  • For each attachment, conditionally check, does it end in XML
  • If yes, insert row to a SQL Server, filling in various fields.   

    Any advice would be gratefully received. At the moment, as this query hasn't yielded to Google fu, I'm looking at whether we can unpack the binary data from the attachment instead - though this feels like the long way round and not quite right.

    Thank you for your time if you are able to suggest anything.

Under review

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.

Helpful resources

Quick Links

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Tomac Profile Picture

Tomac 986 Moderator

#2
stampcoin Profile Picture

stampcoin 699 Super User 2025 Season 2

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 577 Super User 2025 Season 2