<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Uncategorized Archives : Binary Bits</title>
	<atom:link href="https://blog.binarybits.net/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.binarybits.net/category/uncategorized/</link>
	<description>Bits &#38; Pieces - A blog by Kannan Balasubramanian</description>
	<lastBuildDate>Mon, 03 May 2021 10:51:30 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Generate PDF from SharePoint Online list item using Power Automate</title>
		<link>https://blog.binarybits.net/generate-pdf-from-sharepoint-online-list-item-using-power-automate/</link>
					<comments>https://blog.binarybits.net/generate-pdf-from-sharepoint-online-list-item-using-power-automate/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Sat, 24 Apr 2021 09:20:00 +0000</pubDate>
				<category><![CDATA[Power Automate]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[SharePoint Online]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=1491</guid>

					<description><![CDATA[<p>Generating a PDF from SharePoint used to be a common requirement and when using server-side object model, it was easy to use some kind of PDF library and generate PDFs. But in SharePoint Online we can use Power Automate to generate PDFs and the following are the steps that can be used for this. There [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/generate-pdf-from-sharepoint-online-list-item-using-power-automate/">Generate PDF from SharePoint Online list item using Power Automate</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Generating a PDF from SharePoint used to be a common requirement and when using server-side object model, it was easy to use some kind of PDF library and generate PDFs. But in SharePoint Online we can use Power Automate to generate PDFs and the following are the steps that can be used for this.</p>





<p>There are two ways by which a PDF can be generated.</p>



<ul class="wp-block-list"><li>Using OneDrive for Business&#8217;s &#8220;Convert HTML file to PDF&#8221;</li><li>Word Online&#8217;s &#8220;Populate a Microsoft Word Template&#8221; &amp; &#8220;Convert Word Document to PDF&#8221; (These are premium action so a premium license is required and is in preview as of Feb 2021.)</li></ul>



<p>In my example the scenario is to generate an invite pass for attendees attending a conference.</p>



<h1 class="wp-block-heading">The generated PDF</h1>



<p>The generated PDF will look like the following.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate.png"><img fetchpriority="high" decoding="async" width="726" height="1024" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-726x1024.png" alt="" class="wp-image-1492" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-726x1024.png 726w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-213x300.png 213w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-768x1083.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-1090x1536.png 1090w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-705x994.png 705w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate.png 1203w" sizes="(max-width: 726px) 100vw, 726px" /></a></figure></div>



<h1 class="wp-block-heading">The data source</h1>



<h2 class="wp-block-heading">SharePoint List</h2>



<p>Here we are using SharePoint Online and the data source is a simple SharePoint list which contains the following.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-1.png"><img decoding="async" width="1024" height="178" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-1-1024x178.png" alt="" class="wp-image-1493" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-1-1024x178.png 1024w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-1-300x52.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-1-768x134.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-1-1536x267.png 1536w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-1-705x123.png 705w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-1.png 1839w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure></div>



<h2 class="wp-block-heading">OneDrive for Business</h2>



<p>The OneDrive for Business has two artificats</p>



<ol class="wp-block-list"><li>A Logo image is used for both methods.</li><li>A Microsoft Word Document (This will be used for the second method and not for the first method)</li></ol>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-10.png"><img decoding="async" width="1024" height="240" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-10-1024x240.png" alt="" class="wp-image-1495" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-10-1024x240.png 1024w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-10-300x70.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-10-768x180.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-10-705x165.png 705w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-10.png 1464w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Please note that for both methods, the Power Automate is triggered whenever the SharePoint list item is created or modified.</p></blockquote>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>In the below article when the product &#8220;OneDrive&#8221; is mentioned, it&#8217;s actually &#8220;OneDrive for Business&#8221;.</p></blockquote>



<h1 class="wp-block-heading">Method 1: Using OneDrive for Business&#8217;s &#8220;Convert HTML file to PDF&#8221;</h1>



<p>The trigger is when a SharePoint List item is created or modified.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-23.png"><img loading="lazy" decoding="async" width="911" height="278" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-23.png" alt="" class="wp-image-1497" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-23.png 911w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-23-300x92.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-23-768x234.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-23-705x215.png 705w" sizes="auto, (max-width: 911px) 100vw, 911px" /></a></figure></div>



<p>The next action would be to fetch the image of the logo located in the OneDrive.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-34.png"><img loading="lazy" decoding="async" width="914" height="224" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-34.png" alt="" class="wp-image-1498" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-34.png 914w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-34-300x74.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-34-768x188.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-34-705x173.png 705w" sizes="auto, (max-width: 914px) 100vw, 914px" /></a></figure></div>



<p>Now we have to convert the logo into a Uri format using the expression editor and initialize a variable with it.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-41.png"><img loading="lazy" decoding="async" width="577" height="146" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-41.png" alt="" class="wp-image-1500" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-41.png 577w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-41-300x76.png 300w" sizes="auto, (max-width: 577px) 100vw, 577px" /></a></figure></div>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">dataUri(outputs('Get_logo_file_content')?['body'])</pre></div>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-40.png"><img loading="lazy" decoding="async" width="911" height="277" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-40.png" alt="" class="wp-image-1499" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-40.png 911w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-40-300x91.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-40-768x234.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-40-705x214.png 705w" sizes="auto, (max-width: 911px) 100vw, 911px" /></a></figure></div>



<h2 class="wp-block-heading">Creating the HTML Content</h2>



<p>Next is the important action where the actual HTML content will be created.</p>



<h3 class="wp-block-heading">HTML Content Method 1: Using Simple HTML script like below.</h3>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text/html&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}">&lt;html&gt;
    &lt;body&gt;
        &lt;p&gt;
            &lt;img style=&quot;display: block; margin-left: auto; margin-right: auto;&quot; src=&quot;&quot; alt=&quot;&quot;&gt;
            &lt;img&gt;
        &lt;/p&gt;
        &lt;p style=&quot;text-align: center;&quot;&gt;
            &lt;h1&gt;
            &lt;/h1&gt;
        &lt;/p&gt;
        &lt;p style=&quot;text-align: center;&quot;&gt;
            &lt;h2&gt;
            &lt;/h2&gt;
        &lt;/p&gt;
    &lt;/body&gt;
&lt;/html&gt;</pre></div>



<p>For the seasoned HTML developer who is well versed with HTML &amp; CSS, he/she/they can create the HTML content or the other easiest method is to use the Microsoft Word desktop software to create the HTML.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>If you use a simple method, do make sure the CSS is perfect. For the most part I tried, the conversion from HTML to PDF kept ignore the CSS, hence the second method.</p></blockquote>



<h3 class="wp-block-heading">HTML Content Method 2: Using Microsoft Word</h3>



<ol class="wp-block-list"><li>Open the Microsoft Word.</li><li>Design the contents.</li><li>Save the file as &#8220;Web Page, Filtered&#8221;.</li><li>Open that file using an HTML Editor or Notepad and copy the contents.</li></ol>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-44.png"><img loading="lazy" decoding="async" width="1024" height="970" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-44-1024x970.png" alt="" class="wp-image-1503" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-44-1024x970.png 1024w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-44-300x284.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-44-768x727.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-44-705x668.png 705w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-44.png 1454w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure></div>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-43.png"><img loading="lazy" decoding="async" width="629" height="179" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-43.png" alt="" class="wp-image-1502" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-43.png 629w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-43-300x85.png 300w" sizes="auto, (max-width: 629px) 100vw, 629px" /></a></figure></div>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:true,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;htmlmixed&quot;,&quot;mime&quot;:&quot;text/html&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;HTML&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;html&quot;}">&lt;html&gt;

&lt;head&gt;
	&lt;meta http-equiv=Content-Type content=&quot;text/html; charset=windows-1252&quot;&gt;
	&lt;meta name=Generator content=&quot;Microsoft Word 15 (filtered)&quot;&gt;
	&lt;style&gt;
		&lt;!--
		/* Font Definitions */
		@font-face {
			font-family: &quot;Cambria Math&quot;;
			panose-1: 2 4 5 3 5 4 6 3 2 4;
		}

		@font-face {
			font-family: Calibri;
			panose-1: 2 15 5 2 2 2 4 3 2 4;
		}

		@font-face {
			font-family: &quot;Calibri Light&quot;;
			panose-1: 2 15 3 2 2 2 4 3 2 4;
		}

		/* Style Definitions */
		p.MsoNormal,
		li.MsoNormal,
		div.MsoNormal {
			margin-top: 0cm;
			margin-right: 0cm;
			margin-bottom: 8.0pt;
			margin-left: 0cm;
			line-height: 107%;
			font-size: 11.0pt;
			font-family: &quot;Calibri&quot;, sans-serif;
		}

		h1 {
			mso-style-link: &quot;Heading 1 Char&quot;;
			margin-top: 12.0pt;
			margin-right: 0cm;
			margin-bottom: 0cm;
			margin-left: 0cm;
			line-height: 107%;
			page-break-after: avoid;
			font-size: 16.0pt;
			font-family: &quot;Calibri Light&quot;, sans-serif;
			color: #2F5496;
			font-weight: normal;
		}

		span.Heading1Char {
			mso-style-name: &quot;Heading 1 Char&quot;;
			mso-style-link: &quot;Heading 1&quot;;
			font-family: &quot;Calibri Light&quot;, sans-serif;
			color: #2F5496;
		}

		.MsoChpDefault {
			font-family: &quot;Calibri&quot;, sans-serif;
		}

		.MsoPapDefault {
			margin-bottom: 8.0pt;
			line-height: 107%;
		}

		@page WordSection1 {
			size: 595.3pt 841.9pt;
			margin: 72.0pt 72.0pt 72.0pt 72.0pt;
		}

		div.WordSection1 {
			page: WordSection1;
		}
		--&gt;
	&lt;/style&gt;

&lt;/head&gt;

&lt;body lang=EN-IN style='word-wrap:break-word'&gt;

	&lt;div class=WordSection1&gt;

		&lt;p class=MsoNormal align=center style='text-align:center'&gt;&lt;img width=200 height=200 id=&quot;Picture 1&quot;
				src=&quot;Word-HTML_files/image001.png&quot; alt=&quot;Icon&amp;#10;&amp;#10;Description automatically generated&quot;&gt;&lt;/p&gt;

		&lt;h1 align=center style='text-align:center'&gt;Kannan Balasubramanian&lt;/h1&gt;

		&lt;p class=MsoNormal align=center style='text-align:center'&gt;2&lt;/p&gt;

	&lt;/div&gt;

&lt;/body&gt;

&lt;/html&gt;</pre></div>



<p>Create an action to initialise a variable and paste the contents. Replace the image source with &#8220;LogoUri&#8221; variable, Title &amp; ID from the trigger &#8220;When an item is created or modified&#8221;.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-3.png"><img loading="lazy" decoding="async" width="244" height="1024" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-3-244x1024.png" alt="" class="wp-image-1508" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-3-244x1024.png 244w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-3-768x3221.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-3-366x1536.png 366w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-3-488x2048.png 488w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-3-705x2957.png 705w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-3.png 910w" sizes="auto, (max-width: 244px) 100vw, 244px" /></a></figure></div>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">variables('LogoUri')</pre></div>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">triggerOutputs()?['body/Title']</pre></div>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">triggerOutputs()?['body/ID']</pre></div>



<p>Now the HTML contents should be saved to a HTML file. We are going to use OneDrive&#8217;s &#8220;Create file&#8221; action and will use the same &#8220;Dev&#8221; folder to create the file and use the ID as file name to uniquely generate a file for each item and the file content as the &#8220;HTMLContent&#8221; variable.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-4.png"><img loading="lazy" decoding="async" width="912" height="280" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-4.png" alt="" class="wp-image-1509" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-4.png 912w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-4-300x92.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-4-768x236.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-4-705x216.png 705w" sizes="auto, (max-width: 912px) 100vw, 912px" /></a></figure></div>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">triggerOutputs()?['body/ID']</pre></div>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">variables('HTMLContent')</pre></div>



<p>The created HTML file now can be converted to a PDF file and we will use OneDrive&#8217;s &#8220;Convert file using path&#8221; action. The &#8220;File Path&#8221; will rely on the &#8220;Create HTML file&#8221; action&#8217;s &#8220;Path&#8221; property.</p>



<h2 class="wp-block-heading">Converting HTML Content to PDF</h2>



<figure class="wp-block-pullquote"><blockquote><p>This action is in preview as of February 2021.</p></blockquote></figure>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-5.png"><img loading="lazy" decoding="async" width="912" height="220" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-5.png" alt="" class="wp-image-1510" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-5.png 912w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-5-300x72.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-5-768x185.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-5-705x170.png 705w" sizes="auto, (max-width: 912px) 100vw, 912px" /></a></figure></div>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">outputs('Create_HTML_file')?['body/Path']</pre></div>



<p>Once converted the PDF content will be saved as a file using OneDrive&#8217;s &#8220;Create file&#8221; action.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-6.png"><img loading="lazy" decoding="async" width="909" height="277" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-6.png" alt="" class="wp-image-1511" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-6.png 909w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-6-300x91.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-6-768x234.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-6-705x215.png 705w" sizes="auto, (max-width: 909px) 100vw, 909px" /></a></figure></div>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">triggerOutputs()?['body/ID']</pre></div>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">outputs('Convert_HTML_file_to_PDF_using_path')?['body']</pre></div>



<h2 class="wp-block-heading">Deleting the HTML File</h2>



<p>If required we will use OneDrive&#8217;s &#8220;Delete file&#8221; action to delete the HTML file which was generated previously to avoid wasting the space.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-7.png"><img loading="lazy" decoding="async" width="909" height="166" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-7.png" alt="" class="wp-image-1512" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-7.png 909w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-7-300x55.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-7-768x140.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-7-705x129.png 705w" sizes="auto, (max-width: 909px) 100vw, 909px" /></a></figure></div>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">outputs('Create_HTML_file')?['body/Path']</pre></div>



<h2 class="wp-block-heading">Testing</h2>



<p>Now save the Power Automate and test it once to check if it&#8217;s working fine.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-9.png"><img loading="lazy" decoding="async" width="506" height="463" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-9.png" alt="" class="wp-image-1514" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-9.png 506w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-9-300x275.png 300w" sizes="auto, (max-width: 506px) 100vw, 506px" /></a></figure></div>



<p>Create a new item in SharePoint and save it.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-11.png"><img loading="lazy" decoding="async" width="1024" height="401" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-11-1024x401.png" alt="" class="wp-image-1515" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-11-1024x401.png 1024w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-11-300x117.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-11-768x300.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-11-705x276.png 705w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-11.png 1194w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure></div>



<p>Go to OneDrive and check if the file is generated.</p>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-12.png"><img loading="lazy" decoding="async" width="1024" height="262" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-12-1024x262.png" alt="" class="wp-image-1516" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-12-1024x262.png 1024w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-12-300x77.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-12-768x197.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-12-705x180.png 705w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-12.png 1391w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>Open the file to check if it has been created.</p>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-15.png"><img loading="lazy" decoding="async" width="1024" height="532" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-15-1024x532.png" alt="" class="wp-image-1519" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-15-1024x532.png 1024w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-15-300x156.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-15-768x399.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-15-1536x798.png 1536w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-15-2048x1063.png 2048w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-15-705x366.png 705w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<h1 class="wp-block-heading">Method 2: Using Word Online’s “Convert Word Document to PDF”</h1>



<p>The trigger is when a SharePoint List item is created or modified.</p>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-23.png"><img loading="lazy" decoding="async" width="911" height="278" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-23.png" alt="" class="wp-image-1497" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-23.png 911w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-23-300x92.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-23-768x234.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-23-705x215.png 705w" sizes="auto, (max-width: 911px) 100vw, 911px" /></a></figure>



<p>The next action would be to fetch the image of the logo located in the OneDrive.</p>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-34.png"><img loading="lazy" decoding="async" width="914" height="224" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-34.png" alt="" class="wp-image-1498" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-34.png 914w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-34-300x74.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-34-768x188.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-34-705x173.png 705w" sizes="auto, (max-width: 914px) 100vw, 914px" /></a></figure>



<p>Now we have to convert the logo into a Uri format using the expression editor.</p>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-40.png"><img loading="lazy" decoding="async" width="911" height="277" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-40.png" alt="" class="wp-image-1499" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-40.png 911w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-40-300x91.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-40-768x234.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-40-705x214.png 705w" sizes="auto, (max-width: 911px) 100vw, 911px" /></a></figure>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-41.png"><img loading="lazy" decoding="async" width="577" height="146" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-41.png" alt="" class="wp-image-1500" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-41.png 577w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-41-300x76.png 300w" sizes="auto, (max-width: 577px) 100vw, 577px" /></a></figure>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">dataUri(outputs('Get_logo_file_content')?['body'])</pre></div>



<h2 class="wp-block-heading">Creating Word template</h2>



<p>Open a word and if the developer tab is not available, configure the word to make it visible as shown below.</p>



<ul class="wp-block-list"><li>Click on the tab &#8220;File.</li><li>Click on the menu &#8220;Options&#8221;</li><li>Click on the tab &#8220;Customize Ribbon&#8221;</li><li>Check the item &#8220;Developer&#8221; if not already checked.</li></ul>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-16.png"><img loading="lazy" decoding="async" width="797" height="240" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-16.png" alt="" class="wp-image-1522" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-16.png 797w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-16-300x90.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-16-768x231.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-16-705x212.png 705w" sizes="auto, (max-width: 797px) 100vw, 797px" /></a></figure></div>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-17.png"><img loading="lazy" decoding="async" width="1024" height="970" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-17-1024x970.png" alt="" class="wp-image-1523" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-17-1024x970.png 1024w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-17-300x284.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-17-768x727.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-17-705x668.png 705w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-17.png 1454w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure></div>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-20.png"><img loading="lazy" decoding="async" width="1024" height="835" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-20-1024x835.png" alt="" class="wp-image-1524" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-20-1024x835.png 1024w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-20-300x245.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-20-768x627.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-20-705x575.png 705w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-20.png 1260w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure></div>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-21.png"><img loading="lazy" decoding="async" width="1024" height="835" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-21-1024x835.png" alt="" class="wp-image-1525" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-21-1024x835.png 1024w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-21-300x245.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-21-768x627.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-21-705x575.png 705w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-21.png 1260w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure></div>



<p>Now you should have a developer tab in the ribbon.</p>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-22.png"><img loading="lazy" decoding="async" width="1024" height="134" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-22-1024x134.png" alt="" class="wp-image-1526" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-22-1024x134.png 1024w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-22-300x39.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-22-768x100.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-22-705x92.png 705w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-22.png 1447w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>Now use the &#8220;Picture Control Content&#8221; to add a place holder for the logo.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-25.png"><img loading="lazy" decoding="async" width="141" height="116" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-25.png" alt="" class="wp-image-1529"/></a></figure></div>



<p>Once added, click on the placed &#8220;Picture Control Content&#8221; and then click on &#8220;Properties&#8221; in the ribbon to set the &#8220;Title&#8221; as &#8220;Logo&#8221; &amp; &#8220;Tag&#8221; as &#8220;Logo&#8221;</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-26.png"><img loading="lazy" decoding="async" width="152" height="111" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-26.png" alt="" class="wp-image-1530" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-26.png 152w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-26-150x111.png 150w" sizes="auto, (max-width: 152px) 100vw, 152px" /></a></figure></div>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-28.png"><img loading="lazy" decoding="async" width="410" height="427" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-28.png" alt="" class="wp-image-1532" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-28.png 410w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-28-288x300.png 288w" sizes="auto, (max-width: 410px) 100vw, 410px" /></a></figure></div>



<p>Repeat the same for Title &amp; ID using the &#8220;Rich Text Content Control&#8221;</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-29.png"><img loading="lazy" decoding="async" width="141" height="120" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-29.png" alt="" class="wp-image-1533"/></a></figure></div>



<p>Once added, click on the properties to set a &#8220;Title&#8221; as &#8220;Title&#8221; &amp; &#8220;Tag&#8221; as &#8220;Title&#8221; for the title place holder and &#8220;Title&#8221; as &#8220;Id&#8221; &amp; &#8220;Tag&#8221; as &#8220;Id&#8221; for ID place holder and use formats like alignment and text styles in the &#8220;Home tab&#8221;.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-31.png"><img loading="lazy" decoding="async" width="1024" height="132" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-31-1024x132.png" alt="" class="wp-image-1535" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-31-1024x132.png 1024w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-31-300x39.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-31-768x99.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-31-705x91.png 705w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-31.png 1445w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure></div>



<p>The word document should look like below.</p>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-30.png"><img loading="lazy" decoding="async" width="1024" height="970" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-30-1024x970.png" alt="" class="wp-image-1534" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-30-1024x970.png 1024w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-30-300x284.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-30-768x727.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-30-705x668.png 705w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-30.png 1454w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>Now save the file as a normal Word document with .docx extension. Upload the word document into OneDrive as &#8220;Invite-Template.docx&#8221;</p>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-10.png"><img decoding="async" width="1024" height="240" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-10-1024x240.png" alt="" class="wp-image-1495" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-10-1024x240.png 1024w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-10-300x70.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-10-768x180.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-10-705x165.png 705w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-10.png 1464w" sizes="(max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>Now lets go back to the Power Automate and add an action &#8220;Populate a Microsoft Word template&#8221; of &#8220;Word Online&#8221;. Choose the location of &#8220;File&#8221; where the template file was uploaded. For Logo use the &#8220;File Content&#8221; from the &#8220;Get logo file content&#8221; (Note: We are not using the &#8220;LogoUri&#8221; variable here). For &#8220;Title&#8221; &amp; &#8220;Id&#8221;, use the &#8220;Title&#8221; &amp; &#8220;ID&#8221; from the trigger &#8220;When an item is created or modified&#8221;.</p>



<figure class="wp-block-pullquote"><blockquote><p>This is a premium action so a premium license is required and is in preview as of February 2021.</p></blockquote></figure>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-33.png"><img loading="lazy" decoding="async" width="909" height="448" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-33.png" alt="" class="wp-image-1538" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-33.png 909w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-33-300x148.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-33-768x379.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-33-705x347.png 705w" sizes="auto, (max-width: 909px) 100vw, 909px" /></a></figure>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">outputs('Get_logo_file_content')?['body']</pre></div>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">triggerOutputs()?['body/Title']</pre></div>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">triggerOutputs()?['body/ID']</pre></div>



<p>Now add OneDrive&#8217;s &#8220;Create File&#8221; action. Choose the &#8220;Folder Path&#8221; from OneDrive, where the filled Word document should be saved, along with the &#8220;File Name&#8221; being ID of the SharePoint item and &#8220;File Content&#8221; from the action &#8220;Populate a Microosft Word template&#8221;.</p>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-35.png"><img loading="lazy" decoding="async" width="910" height="283" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-35.png" alt="" class="wp-image-1539" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-35.png 910w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-35-300x93.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-35-768x239.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-35-705x219.png 705w" sizes="auto, (max-width: 910px) 100vw, 910px" /></a></figure>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">triggerOutputs()?['body/ID']</pre></div>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">outputs('Populate_a_Microsoft_Word_template')?['body']</pre></div>



<h2 class="wp-block-heading">Converting Word Content to PDF</h2>



<p>Now lets convert the Word document into PDF by creating the action &#8220;Convert Word Document to PDF&#8221; of &#8220;Word Online&#8221; pointing the &#8220;File&#8221; to the path returned by &#8220;Create Word file via Word template&#8221;.</p>



<figure class="wp-block-pullquote"><blockquote><p>This is a premium action so a premium license is required and is in preview as of February 2021.</p></blockquote></figure>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-36.png"><img loading="lazy" decoding="async" width="908" height="276" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-36.png" alt="" class="wp-image-1540" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-36.png 908w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-36-300x91.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-36-768x233.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-36-705x214.png 705w" sizes="auto, (max-width: 908px) 100vw, 908px" /></a></figure>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">outputs('Create_Word_file_via_Word_template')?['body/Path']</pre></div>



<p>Now let&#8217;s use OneDrive&#8217;s &#8220;Create file&#8221; action to create the PDF file in OneDrive.</p>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-39.png"><img loading="lazy" decoding="async" width="912" height="279" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-39.png" alt="" class="wp-image-1543" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-39.png 912w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-39-300x92.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-39-768x235.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-39-705x216.png 705w" sizes="auto, (max-width: 912px) 100vw, 912px" /></a></figure>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">triggerOutputs()?['body/ID']</pre></div>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">outputs('Convert_Word_Document_to_PDF')?['body']</pre></div>



<h2 class="wp-block-heading">Deleting the Word File</h2>



<p>If required we will use OneDrive&#8217;s &#8220;Delete file&#8221; action to delete the Word file which was generated previously to avoid wasting the space.</p>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-38.png"><img loading="lazy" decoding="async" width="913" height="172" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-38.png" alt="" class="wp-image-1542" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-38.png 913w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-38-300x57.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-38-768x145.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-38-705x133.png 705w" sizes="auto, (max-width: 913px) 100vw, 913px" /></a></figure>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">outputs('Create_Word_file_via_Word_template')?['body/Path']</pre></div>



<h2 class="wp-block-heading">Testing</h2>



<p>Now save the Power Automate and test it once to check if it&#8217;s working fine.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-9.png"><img loading="lazy" decoding="async" width="506" height="463" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-9.png" alt="" class="wp-image-1514" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-9.png 506w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-9-300x275.png 300w" sizes="auto, (max-width: 506px) 100vw, 506px" /></a></figure></div>



<p>Create a new item in SharePoint and save it.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-11.png"><img loading="lazy" decoding="async" width="1024" height="401" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-11-1024x401.png" alt="" class="wp-image-1515" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-11-1024x401.png 1024w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-11-300x117.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-11-768x300.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-11-705x276.png 705w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-11.png 1194w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure></div>



<p>Go to OneDrive and check if the file is generated.</p>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-12.png"><img loading="lazy" decoding="async" width="1024" height="262" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-12-1024x262.png" alt="" class="wp-image-1516" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-12-1024x262.png 1024w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-12-300x77.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-12-768x197.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-12-705x180.png 705w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-12.png 1391w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>



<p>Open the file to check if it has been created.</p>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-15.png"><img loading="lazy" decoding="async" width="1024" height="532" src="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-15-1024x532.png" alt="" class="wp-image-1519" srcset="https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-15-1024x532.png 1024w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-15-300x156.png 300w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-15-768x399.png 768w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-15-1536x798.png 1536w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-15-2048x1063.png 2048w, https://blog.binarybits.net/wp-content/uploads/2021/05/Generate-PDF-from-SharePoint-Online-list-item-using-Power-Automate-15-705x366.png 705w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></a></figure>
<p>The post <a href="https://blog.binarybits.net/generate-pdf-from-sharepoint-online-list-item-using-power-automate/">Generate PDF from SharePoint Online list item using Power Automate</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/generate-pdf-from-sharepoint-online-list-item-using-power-automate/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Item level permission in SharePoint using REST and Power Automate</title>
		<link>https://blog.binarybits.net/item-level-permission-in-sharepoint-using-rest-and-power-automate/</link>
					<comments>https://blog.binarybits.net/item-level-permission-in-sharepoint-using-rest-and-power-automate/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Tue, 09 Mar 2021 07:32:19 +0000</pubDate>
				<category><![CDATA[Power Automate]]></category>
		<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[SharePoint Online]]></category>
		<guid isPermaLink="false">http://blog.binarybits.net/?p=1477</guid>

					<description><![CDATA[<p>Sometimes when an item is created we might need to set item level permission for those items. Fortunately, SharePoint&#8217;s REST API can help with this and Power Automate / Flow supports SharePoint HTTP calls. For this to work, make sure the Power Automate is created with an account having site collection administrator access. First the [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/item-level-permission-in-sharepoint-using-rest-and-power-automate/">Item level permission in SharePoint using REST and Power Automate</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>Sometimes when an item is created we might need to set item level permission for those items. Fortunately, SharePoint&#8217;s REST API can help with this and Power Automate / Flow supports SharePoint HTTP calls.</p>



<figure class="wp-block-pullquote"><blockquote><p>For this to work, make sure the Power Automate is created with an account having site collection administrator access.</p></blockquote></figure>



<h2 class="wp-block-heading">First the basics of how this works</h2>



<p>Step 1 is to identify to whom the permissions should be granted to. It can be either a person or a group.</p>



<p>Step 2 is to identify what kind of permission i.e. role should be granted.</p>



<p>Step 3 is breaking the inheritance.</p>



<p>Step 4 is assigning the permission.</p>



<h2 class="wp-block-heading">Second is knowing the supporting APIs to gather the information</h2>



<h3 class="wp-block-heading">Step 1: To whom the permission should be granted?</h3>



<h4 class="wp-block-heading">Individual user</h4>



<p>To identify the individual user the following API can be used. Commonly everyone relies on e-mail ID so lets take that as an example</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">URL: _api/web/SiteUsers/getByEmail('email@domain.com')
Method: Get</pre></div>



<p>When you use Power Automate, make sure to extract the ID and place it in a variable.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">body('Get_User_Id')['d']['Id']</pre></div>



<h4 class="wp-block-heading">Site Group</h4>



<p>To identify the site group the following API can be used.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">URL: _api/web/sitegroups/getbyname('Group Name')
Method: Get</pre></div>



<p>When you use Power Automate, make sure to extract the ID and place it in a variable.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">body('Get_Group_Id')['d']['Id']</pre></div>



<h3 class="wp-block-heading">Step 2: What kind of permission?</h3>



<p>This is defined by the role definitions available in the site. The following API will help in identifying the role definitions and their ID.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">URL: _api/roledefinitions/getbyname('Full Control')
Method: Get</pre></div>



<p>When you use Power Automate, make sure to extract the ID and place it in a variable.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:false,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">body('Get_Role_Definition_Id')['d']['Id']</pre></div>



<h3 class="wp-block-heading">Step 3: Breaking the inheritance</h3>



<p>For this first thing is we need to identify the target for which the inheritance should be broken. In the following example it&#8217;s a list item.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">URL: _api/lists/getByTitle('&lt;List Name&gt;')/items(&lt;Item ID&gt;)/breakroleinheritance(copyRoleAssignments=false,clearSubscopes=true)
Method: POST</pre></div>



<h4 class="wp-block-heading">Example:</h4>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">URL: _api/lists/getByTitle('Test List')/items(1)/breakroleinheritance(copyRoleAssignments=false,clearSubscopes=true)</pre></div>



<h3 class="wp-block-heading">Step 4: Assigning permission</h3>



<p>As said before permission can be assigned to an individual or a group. The following API will help with that</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">URL: _api/lists/getByTitle('&lt;List Name&gt;')/items(&lt;Item ID&gt;)/roleassignments/addroleassignment(principalid=&lt;User ID or Group ID&gt;,roledefid=&lt;Role ID&gt;)
Method: POST</pre></div>



<h4 class="wp-block-heading">Example:</h4>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:&quot;language&quot;,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;text/javascript&quot;,&quot;theme&quot;:&quot;default&quot;,&quot;lineNumbers&quot;:true,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JavaScript&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;js&quot;}">URL: _api/lists/getByTitle('Test List')/items(1)/roleassignments/addroleassignment(principalid=10,roledefid=1073741829)</pre></div>



<p>Following is the list of out of the box role definitions which I came across in the internet</p>



<figure class="wp-block-table is-style-regular"><table><tbody><tr><td><strong>Role Definition Name</strong></td><td><strong>Role Definition Id</strong></td></tr><tr><td>Full Control</td><td>1073741829</td></tr><tr><td>Design</td><td>1073741828</td></tr><tr><td>Edit</td><td>1073741830</td></tr><tr><td>Contribute</td><td>1073741827</td></tr><tr><td>Read</td><td>1073741826</td></tr><tr><td>View Only</td><td>1073741924</td></tr><tr><td>Limited Access</td><td>1073741825</td></tr></tbody></table></figure>



<h2 class="wp-block-heading">Useful URL</h2>



<p>You can refer the following URL which has code example to use REST api.</p>



<p><a href="https://docs.microsoft.com/en-us/sharepoint/dev/sp-add-ins/set-custom-permissions-on-a-list-by-using-the-rest-interface" target="_blank" rel="noreferrer noopener">Set custom permissions on a list by using the REST interface</a></p>
<p>The post <a href="https://blog.binarybits.net/item-level-permission-in-sharepoint-using-rest-and-power-automate/">Item level permission in SharePoint using REST and Power Automate</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/item-level-permission-in-sharepoint-using-rest-and-power-automate/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>SharePoint Online theme error &#8211; There was an error while attempting to get the themes</title>
		<link>https://blog.binarybits.net/sharepoint-online-theme-error-there-was-an-error-while-attempting-to-get-the-themes/</link>
					<comments>https://blog.binarybits.net/sharepoint-online-theme-error-there-was-an-error-while-attempting-to-get-the-themes/#comments</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Thu, 05 Mar 2020 07:24:47 +0000</pubDate>
				<category><![CDATA[SharePoint]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Error]]></category>
		<category><![CDATA[SharePoint Online]]></category>
		<category><![CDATA[Theme]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=1107</guid>

					<description><![CDATA[<p>Recently when I was trying to change the theme of a SharePoint online site collection, it threw an error &#8220;There was an error while attempting to get the themes&#8221; The error looks like the one shown below (Taken from Microsoft Tech Community) To fix this error, the easiest method as of March 2020 is do [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/sharepoint-online-theme-error-there-was-an-error-while-attempting-to-get-the-themes/">SharePoint Online theme error &#8211; There was an error while attempting to get the themes</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p><img decoding="async" class="wp-image-1160" style="width: 32px;" src="https://blog.binarybits.net/wp-content/uploads/2020/03/microsoft-sharepoint-logo.svg" alt="Microsoft SharePoint Logo"> Recently when I was trying to change the theme of a SharePoint online site collection, it threw an error &#8220;There was an error while attempting to get the themes&#8221;</p>



<p class="has-normal-font-size">The error looks like the one shown below (Taken from <a href="https://techcommunity.microsoft.com/t5/sharepoint/sharepoint-themes-there-was-an-error-while-attempting-to-get-the/m-p/319409">Microsoft Tech Community</a>)</p>



<figure class="wp-block-image size-large"><a href="https://blog.binarybits.net/wp-content/uploads/2020/03/error_theme.png"><img loading="lazy" decoding="async" width="298" height="328" src="https://blog.binarybits.net/wp-content/uploads/2020/03/error_theme.png" alt="There was an error while attempting to get the themes" class="wp-image-1108" srcset="https://blog.binarybits.net/wp-content/uploads/2020/03/error_theme.png 298w, https://blog.binarybits.net/wp-content/uploads/2020/03/error_theme-273x300.png 273w" sizes="auto, (max-width: 298px) 100vw, 298px" /></a></figure>



<p>To fix this error, the easiest method as of March 2020 is do the following.</p>



<ol class="wp-block-list"><li>Click on &#8220;Classic change the look options&#8221; menu item shown in the screenshot above.</li><li>Choose one of the theme.</li><li>Preview it by clicking on &#8220;Try it out&#8221;.</li><li>Then click on &#8220;Yes, keep it&#8221;</li><li>Again load the home page</li><li>Try changing the theme, and the error should be gone.</li></ol>



<p>Thanks to Rob for providing the work around <a href="https://techcommunity.microsoft.com/t5/sharepoint/sharepoint-themes-there-was-an-error-while-attempting-to-get-the/m-p/319409">here</a>.</p>
<p>The post <a href="https://blog.binarybits.net/sharepoint-online-theme-error-there-was-an-error-while-attempting-to-get-the-themes/">SharePoint Online theme error &#8211; There was an error while attempting to get the themes</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/sharepoint-online-theme-error-there-was-an-error-while-attempting-to-get-the-themes/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title>Dish &#038; Cable Channel Planner for India</title>
		<link>https://blog.binarybits.net/dish-cable-channel-planner-for-india/</link>
					<comments>https://blog.binarybits.net/dish-cable-channel-planner-for-india/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Tue, 22 Jan 2019 05:47:19 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=1006</guid>

					<description><![CDATA[<p>TRAI has changed the rule for dish and cable channel tariffs so that consumer has the option of choosing channels which they view instead of the service providers forcing to choose the bundle. The following excel will help you in planning.You can click on &#8220;view full size workbook&#8221; button at the bottom right of the [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/dish-cable-channel-planner-for-india/">Dish &#038; Cable Channel Planner for India</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>TRAI has changed the rule for dish and cable channel tariffs so that consumer has the option of choosing channels which they view instead of the service providers forcing to choose the bundle.</p>



<p>The following excel will help you in planning.<br>You can click on &#8220;view full size workbook&#8221; button at the bottom right of the embedded excel or view the excel in full view at <a href="https://kannan.page.link/c6wA">https://kannan.page.link/c6wA</a></p>



<ol class="wp-block-list"><li>Go to &#8220;List of channels&#8221; sheet.</li><li>Set values in column &#8220;Selection Order&#8221; as 1 or 2 or 3 etc. per channel based on your viewing priority.</li><li>Go to &#8220;Pivot&#8221; sheet.</li><li>Right click in the table area and press refresh.</li><li>In &#8220;Selection Order&#8221; choose 1 and/or 2 and/or 3 instead of &#8220;All&#8221; based on your viewing priority.</li><li>Scroll down and view the &#8220;Grand Total&#8221; to know the total price.</li></ol>



<p>For latest pricing visit <a href="https://www.channeltariff.trai.gov.in/">https://www.channeltariff.trai.gov.in/</a></p>



<p><strong>EDIT: I just found out that TRAI itself has an web app which helps in determining the price using various choices. I urge you to visit the site </strong><a href="https://channel.trai.gov.in/"><strong>https://channel.trai.gov.in/</strong></a> <strong>and don&#8217;t forget to click that &#8220;Optimize&#8221; button at the top of the final pricing page.</strong></p>



<p></p>



<p></p>



<figure><iframe loading="lazy" width="700" height="692" src="https://onedrive.live.com/embed?resid=A1FBE45C1F711956%21130&amp;authkey=%21ANyeU4r0EYzc6hw&amp;em=2&amp;AllowTyping=True&amp;ActiveCell='List%20of%20channels'!A1&amp;wdHideGridlines=True&amp;wdHideHeaders=True&amp;wdInConfigurator=True"></iframe></figure>
<p>The post <a href="https://blog.binarybits.net/dish-cable-channel-planner-for-india/">Dish &#038; Cable Channel Planner for India</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/dish-cable-channel-planner-for-india/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Alternatives to &#8220;You are Welcome&#8221;</title>
		<link>https://blog.binarybits.net/alternatives-to-you-are-welcome/</link>
					<comments>https://blog.binarybits.net/alternatives-to-you-are-welcome/#respond</comments>
		
		<dc:creator><![CDATA[Kannan]]></dc:creator>
		<pubDate>Fri, 18 Jan 2019 02:31:59 +0000</pubDate>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[English]]></category>
		<guid isPermaLink="false">https://blog.binarybits.net/?p=1003</guid>

					<description><![CDATA[<p>In my many years of IT service, one of the constant response I get from my customers are the &#8220;Thank You&#8221; note . Generally we respond back to them by writing &#8220;You are welcome&#8221;. But there are other few ways we can respond as well. Positive: My pleasure I’m happy to help Anytime Don’t mention [&#8230;]</p>
<p>The post <a href="https://blog.binarybits.net/alternatives-to-you-are-welcome/">Alternatives to &#8220;You are Welcome&#8221;</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p>In my many years of  IT service, one of the constant response I get from my customers are the &#8220;Thank You&#8221; note . Generally we respond back to them by writing &#8220;You are welcome&#8221;. But there are other few ways we can respond as well.</p>



<p><strong>Positive:</strong><br></p>



<ol class="wp-block-list"><li>My pleasure</li><li>I’m happy to help</li><li>Anytime</li><li>Don’t mention it</li></ol>



<p><strong>Neutral:</strong></p>



<ol class="wp-block-list"><li>You got it</li><li>No worries</li><li>Not a problem</li><li>It was nothing</li><li>Sure</li></ol>
<p>The post <a href="https://blog.binarybits.net/alternatives-to-you-are-welcome/">Alternatives to &#8220;You are Welcome&#8221;</a> appeared first on <a href="https://blog.binarybits.net">Binary Bits</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://blog.binarybits.net/alternatives-to-you-are-welcome/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Minified using Disk

Served from: blog.binarybits.net @ 2026-04-19 22:38:42 by W3 Total Cache
-->