<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>MS Graph: Send email with attachment</title><link>https://community.appian.com/discussions/f/integrations/40486/ms-graph-send-email-with-attachment</link><description>We are trying to send emails with attachments using the MS Graph sendMail API. 
 We&amp;#39;re seeing an issue where the document is not being converted to Base64, see screenshot below. 
 Is the issue that we&amp;#39;re starting with a json and converting to dictionary</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: MS Graph: Send email with attachment</title><link>https://community.appian.com/thread/154868?ContentTypeID=1</link><pubDate>Tue, 09 Jun 2026 06:01:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bf2dde27-0916-4638-9ea1-2d1da15a3874</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;You tried to create a JSON string using text operations. Then the reference to the document turns into &amp;quot;[Document:xx]&amp;quot;. Now, you try to turn this into a dictionary. How should Appian know what you are referring to?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MS Graph: Send email with attachment</title><link>https://community.appian.com/thread/154859?ContentTypeID=1</link><pubDate>Mon, 08 Jun 2026 17:52:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0a3454b9-1f01-42d1-85ea-7433d7f54502</guid><dc:creator>Guy</dc:creator><description>&lt;p&gt;Amazing that worked with one small change, line 18 should be&amp;nbsp; &amp;quot;contentBytes&amp;quot;: toDocument(fv!item)&lt;/p&gt;
&lt;p&gt;Thank you v much!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: MS Graph: Send email with attachment</title><link>https://community.appian.com/thread/154858?ContentTypeID=1</link><pubDate>Mon, 08 Jun 2026 17:11:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:fc6aef4d-6c7d-4641-a5c1-90d3fe9886cf</guid><dc:creator>Jes&amp;#250;s Hormigos</dc:creator><description>&lt;p&gt;Use&amp;nbsp;the following code in your &amp;quot;attachments&amp;quot; attribute&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;&amp;quot;attachments&amp;quot;: {
      if(
        a!isNullOrEmpty(ri!attached),
        {},
        a!forEach(
          items: ri!attached,
          expression: {
            &amp;quot;@odata.type&amp;quot;: &amp;quot;#microsoft.graph.fileAttachment&amp;quot;,
            &amp;quot;name&amp;quot;: concat(
              document(fv!item, &amp;quot;name&amp;quot;),
              &amp;quot;.&amp;quot;,
              document(fv!item, &amp;quot;extension&amp;quot;)
            ),
            &amp;quot;contentType&amp;quot;: concat(
              &amp;quot;application/&amp;quot;,
              document(fv!item, &amp;quot;extension&amp;quot;)
            ),
            &amp;quot;contentBytes&amp;quot;: fv!item
          }
        )
      )
    }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>