{"id":6357,"date":"2021-02-03T07:08:03","date_gmt":"2021-02-03T07:08:03","guid":{"rendered":"https:\/\/www.softreetechnology.com\/?p=6357"},"modified":"2021-02-03T07:08:03","modified_gmt":"2021-02-03T07:08:03","slug":"create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx","status":"publish","type":"post","link":"https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/","title":{"rendered":"Create A Webpart Which will retrieve the List and Document using SPFx"},"content":{"rendered":"\n<p>In\nthis Blog, we are going to discuss about the creation of a new webpart using\nSPFx(No JavaScript framework).This webpart will represent the data of the\ncorresponding site such as website Name ,website URL ,Total List Count &amp;\nretrieves the name of all custom list and documents.<\/p>\n\n\n\n<p>Let\nus get started \u2026<\/p>\n\n\n\n<p><strong>Step-A:(Creation of Webpart): <\/strong><\/p>\n\n\n\n<p>Open\nCommand Prompt. Go to the drive in which you want to create the Project. Here I\nhave created the project in \u201cc-drive\u201d.<\/p>\n\n\n\n<p>Run\nthe below commands<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>\u201c<strong>cd C:\\<\/strong>\u201d<\/li><li>\u201c<strong>md Webpart<\/strong>\u201d<\/li><\/ul>\n\n\n\n<p>Refer\n<strong>image-1<\/strong> for more details.<strong><\/strong><\/p>\n\n\n\n<p><strong>Image:1<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2021\/02\/1.png\" alt=\"\" class=\"wp-image-6358\"\/><\/figure>\n\n\n\n<p>Refer\n<strong>image-2<\/strong> and run the command<strong> \u201cyo @microsoft\/sharepoint\u201d.<\/strong> Then\nEnter the asked details same as mentioned in <strong>Image-2<\/strong> to create the\nwebpart. The webpart creation may take some time so wait to complete the\ninstallation.<\/p>\n\n\n\n<p>After\ncompletion, you can see a Congratulation message (Check <strong>Image-3<\/strong>).<\/p>\n\n\n\n<p><strong>Image:2<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2021\/02\/2.png\" alt=\"\" class=\"wp-image-6359\"\/><\/figure>\n\n\n\n<p><strong>Image:3<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2021\/02\/3.png\" alt=\"\" class=\"wp-image-6360\"\/><\/figure>\n\n\n\n<p>Then\nrun the command <strong>\u201c<\/strong><strong>code .\u201d <\/strong>to open the Visual studio\ncode.<\/p>\n\n\n\n<p>Expand <strong>src-&gt; webparts<\/strong> (Refer <strong>image-4<\/strong>) to open the files.<\/p>\n\n\n\n<p><strong>Image:4<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2021\/02\/4.png\" alt=\"\" class=\"wp-image-6361\"\/><\/figure>\n\n\n\n<p><strong>Step-B:(Create a New File):<\/strong><\/p>\n\n\n\n<p>Create\na new file inside <strong>C: \\WebPart\\src\\webparts\\dynamicWp<\/strong>. Name it as \u201c<strong>GetList.ts<\/strong>\u201d\nas shown in <strong>image:5.<\/strong><\/p>\n\n\n\n<p><strong>Image:5<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2021\/02\/5.png\" alt=\"\" class=\"wp-image-6362\"\/><\/figure>\n\n\n\n<p><strong>Image:6<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2021\/02\/6.png\" alt=\"\" class=\"wp-image-6363\"\/><\/figure>\n\n\n\n<p><strong>Step-C:(Change the code):<\/strong><\/p>\n\n\n\n<p>Here\nI have mentioned the code for corresponding files. So please refer the\ninstructions accordingly and add\/change the code.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>In \u201c<strong>DynamicWPWebPart.ts<\/strong>\u201d replace the below code.<\/li><\/ul>\n\n\n\n<p>import&nbsp;pnp&nbsp;from&nbsp;&#8220;sp-pnp-js&#8221;;<\/p>\n\n\n\n<p>import&nbsp;{&nbsp;Version&nbsp;}&nbsp;from&nbsp;&#8216;@microsoft\/sp-core-library&#8217;;<\/p>\n\n\n\n<p>import&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;IPropertyPaneConfiguration,<\/p>\n\n\n\n<p>&nbsp;&nbsp;PropertyPaneTextField&nbsp;,<\/p>\n\n\n\n<p>&nbsp;&nbsp;PropertyPaneDropdown<\/p>\n\n\n\n<p>}&nbsp;from&nbsp;&#8216;@microsoft\/sp-property-pane&#8217;;<\/p>\n\n\n\n<p>import&nbsp;{&nbsp;BaseClientSideWebPart&nbsp;}&nbsp;from&nbsp;&#8216;@microsoft\/sp-webpart-base&#8217;;<\/p>\n\n\n\n<p>import&nbsp;{&nbsp;escape&nbsp;}&nbsp;from&nbsp;&#8216;@microsoft\/sp-lodash-subset&#8217;;<\/p>\n\n\n\n<p>import&nbsp;styles&nbsp;from&nbsp;&#8216;.\/DynamicWpWebPart.module.scss&#8217;;<\/p>\n\n\n\n<p>import&nbsp;*&nbsp;as&nbsp;strings&nbsp;from&nbsp;&#8216;DynamicWpWebPartStrings&#8217;;<\/p>\n\n\n\n<p>import&nbsp;MockHttpClient&nbsp;from&nbsp;&#8216;.\/GetList&#8217;;<\/p>\n\n\n\n<p>import{<\/p>\n\n\n\n<p>&nbsp;&nbsp;SPHttpClient,<\/p>\n\n\n\n<p>&nbsp;&nbsp;SPHttpClientResponse<\/p>\n\n\n\n<p>}from&nbsp;&#8216;@microsoft\/sp-http&#8217;;<\/p>\n\n\n\n<p>import&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;Environment,<\/p>\n\n\n\n<p>&nbsp;&nbsp;EnvironmentType<\/p>\n\n\n\n<p>}&nbsp;from&nbsp;&#8216;@microsoft\/sp-core-library&#8217;;<\/p>\n\n\n\n<p>import&nbsp;&#8220;@pnp\/sp\/webs&#8221;;<\/p>\n\n\n\n<p>import&nbsp;&#8220;@pnp\/sp\/lists&#8221;;<\/p>\n\n\n\n<p>import&nbsp;{&nbsp;_List}&nbsp;from&nbsp;&#8216;@pnp\/sp\/lists\/types&#8217;;<\/p>\n\n\n\n<p>export&nbsp;interface&nbsp;IDynamicWpWebPartProps&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;description:&nbsp;string;<\/p>\n\n\n\n<p>&nbsp;&nbsp;List:string;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>export&nbsp;interface&nbsp;ISPLists&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;value:&nbsp;ISPList[];<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>export&nbsp;interface&nbsp;ISPList&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;Title:&nbsp;string;<\/p>\n\n\n\n<p>&nbsp;&nbsp;Id:&nbsp;string;<\/p>\n\n\n\n<p>&nbsp;&nbsp;BaseTemplate:&nbsp;string;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>let&nbsp;array:string[];<\/p>\n\n\n\n<p>export&nbsp;default&nbsp;class&nbsp;DynamicWpWebPart&nbsp;extends&nbsp;BaseClientSideWebPart&lt;IDynamicWpWebPartProps&gt;&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;private&nbsp;_renderList():&nbsp;void&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(Environment.type&nbsp;===&nbsp;EnvironmentType.Local)&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this._getItemsFromList().then((response)&nbsp;=&gt;&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this._listDesign(response.value);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;if&nbsp;(Environment.type&nbsp;==&nbsp;EnvironmentType.SharePoint&nbsp;||<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Environment.type&nbsp;==&nbsp;EnvironmentType.ClassicSharePoint)&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this._getListData()<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.then((response)&nbsp;=&gt;&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this._listDesign(response.value);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;private&nbsp;_listDesign(items:&nbsp;ISPList[]):&nbsp;void&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;let&nbsp;html:&nbsp;string&nbsp;=&nbsp;&#8221;;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;let&nbsp;i&nbsp;=0;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;html+=`<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&gt;&lt;p&nbsp;class=&#8221;${&nbsp;styles.label}&nbsp;style=&#8221;margin:5px;5px;5px;5px;&nbsp;font-weight:&nbsp;bold&#8221;&gt;Total&nbsp;List&nbsp;Count&nbsp;:&nbsp;${items.length}&lt;\/p&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/div&gt;`;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;html&nbsp;+=`&lt;div&gt;&lt;b&nbsp;style=&#8221;font-size:20px;&#8221;&gt;Document&lt;\/b&gt;`<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;items.forEach((item:&nbsp;ISPList)&nbsp;=&gt;&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(item.BaseTemplate==&#8217;101&#8242;)&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;html&nbsp;+=&nbsp;`<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&nbsp;class=&#8221;${styles.list}&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&#8221;${styles.listItem}&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&nbsp;class=&#8221;ms-font-l&#8221;&gt;Document&nbsp;Title&nbsp;:&nbsp;&lt;b&gt;${item.Title}&lt;\/b&gt;&lt;\/span&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/li&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/ul&gt;`;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;});<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;html&nbsp;+=`&nbsp;&lt;\/div&gt;`;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;html&nbsp;+=`&lt;div&gt;&lt;b&nbsp;style=&#8221;font-size:20px;&#8221;&gt;List&lt;\/b&gt;`<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;items.forEach((item1:&nbsp;ISPList)&nbsp;=&gt;&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if(item1.BaseTemplate==&#8217;100&#8242;){<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;html&nbsp;+=&nbsp;`<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&nbsp;class=&#8221;${styles.list}&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&nbsp;class=&#8221;${styles.listItem}&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;span&nbsp;class=&#8221;ms-font&#8221;&gt;List&nbsp;Title&nbsp;:&nbsp;&lt;b&gt;${item1.Title}&lt;\/b&gt;&lt;\/span&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/li&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/ul&gt;`<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;});<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;html&nbsp;+=`&nbsp;&lt;\/div&gt;`;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;const&nbsp;listContainer:&nbsp;Element&nbsp;=&nbsp;this.domElement.querySelector(&#8216;#spListContainer&#8217;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;listContainer.innerHTML&nbsp;=&nbsp;html;<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;private&nbsp;_getListData():&nbsp;Promise&lt;ISPLists&gt;&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;this.context.spHttpClient.get(this.context.pageContext.web.absoluteUrl&nbsp;+&nbsp;`\/_api\/web\/lists?$filter=Hidden&nbsp;eq&nbsp;false`,&nbsp;SPHttpClient.configurations.v1)<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.then((response:&nbsp;SPHttpClientResponse)&nbsp;=&gt;&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;response.json();<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;private&nbsp;_getItemsFromList():&nbsp;Promise&lt;ISPLists&gt;&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;MockHttpClient.get()<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;.then((data:&nbsp;ISPList[])&nbsp;=&gt;&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;listData:&nbsp;ISPLists&nbsp;=&nbsp;{&nbsp;value:&nbsp;data&nbsp;};<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;listData;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})&nbsp;as&nbsp;Promise&lt;ISPLists&gt;;<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;public&nbsp;render():&nbsp;void&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;this.domElement.innerHTML&nbsp;=&nbsp;`&lt;textarea&nbsp;placeholder=&#8221;DynamicWP&#8221;&nbsp;aria-label=&#8221;Add&nbsp;a&nbsp;title&#8221;&nbsp;style=&#8221;height:&nbsp;23px;&nbsp;border:none;font-size:20px;font-weight:&nbsp;bold;&nbsp;width:&nbsp;100%;&#8221;&gt;&lt;\/textarea&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;class=&#8221;${&nbsp;styles.dynamicWp&nbsp;}&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;class=&#8221;${&nbsp;styles.container&nbsp;}&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;class=&#8221;${&nbsp;styles.row&nbsp;}&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;class=&#8221;${&nbsp;styles.column&nbsp;}&#8221;&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&gt;&lt;p&nbsp;class=&#8221;${&nbsp;styles.label}&nbsp;style=&#8221;margin:5px;5px;5px;5px;&nbsp;font-weight:&nbsp;bold&#8221;&gt;WebSite&nbsp;Name&nbsp;:&nbsp;${escape(this.context.pageContext.web.title)}&lt;\/p&gt;&lt;\/div&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&gt;&lt;p&nbsp;class=&#8221;${&nbsp;styles.label}&nbsp;style=&#8221;margin:5px;5px;5px;5px;&nbsp;font-weight:&nbsp;bold&#8221;&gt;WebSite&nbsp;URL&nbsp;:&nbsp;${escape(this.context.pageContext.site.absoluteUrl)}&lt;\/p&gt;&lt;\/div&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div&nbsp;id=&#8221;spListContainer&#8221;\/&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;p&nbsp;class=&#8221;${&nbsp;styles.description&nbsp;}&#8221;&gt;${escape(this.properties.description)}&lt;\/p&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/div&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/div&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/div&gt;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;\/div&gt;`;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;this._renderList();<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;protected&nbsp;get&nbsp;dataVersion():&nbsp;Version&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;Version.parse(&#8216;1.0&#8217;);<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;protected&nbsp;getPropertyPaneConfiguration():&nbsp;IPropertyPaneConfiguration&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pages:&nbsp;[<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;header:&nbsp;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;description:&nbsp;strings.PropertyPaneDescription,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;list&nbsp;:&nbsp;strings.List<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;groups:&nbsp;[<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;groupName:&nbsp;strings.BasicGroupName,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;groupFields:&nbsp;[<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PropertyPaneTextField(&#8216;Description&#8217;,&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;label:&nbsp;strings.DescriptionFieldLabel<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;})<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;]<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;};<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>In \u201c<strong>GetList.ts<\/strong>\u201d add the below code.<\/li><\/ul>\n\n\n\n<p>import&nbsp;{&nbsp;ISPList&nbsp;}&nbsp;from&nbsp;&#8216;.\/DynamicWpWebPart&#8217;;<\/p>\n\n\n\n<p>export&nbsp;default&nbsp;class&nbsp;GetDemoList&nbsp;&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;private&nbsp;static&nbsp;_items:&nbsp;ISPList[]&nbsp;=&nbsp;[{&nbsp;Title:&nbsp;&#8216;List&nbsp;1&#8242;,BaseTemplate:&#8217;101&#8217;,Id:&nbsp;&#8216;1&#8217;&nbsp;},<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;Title:&nbsp;&#8216;List&nbsp;2&#8242;,BaseTemplate:&#8217;101&#8217;&nbsp;,Id:&nbsp;&#8216;2&#8217;&nbsp;},<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;Title:&nbsp;&#8216;List&nbsp;3&#8242;,BaseTemplate:&#8217;101&#8217;,&nbsp;Id:&nbsp;&#8216;3&#8217;&nbsp;,&nbsp;}];<\/p>\n\n\n\n<p>&nbsp;&nbsp;public&nbsp;static&nbsp;get():&nbsp;Promise&lt;ISPList[]&gt;&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;new&nbsp;Promise&lt;ISPList[]&gt;((resolve)&nbsp;=&gt;&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;resolve(GetDemoList._items);<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;});<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>In \u201c<strong>mystrings.d.ts<\/strong>\u201d replace the below code.<\/li><\/ul>\n\n\n\n<p>declare&nbsp;interface&nbsp;IDynamicWpWebPartStrings&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;PropertyPaneDescription:&nbsp;string;<\/p>\n\n\n\n<p>&nbsp;&nbsp;BasicGroupName:&nbsp;string;<\/p>\n\n\n\n<p>&nbsp;&nbsp;DescriptionFieldLabel:&nbsp;string;<\/p>\n\n\n\n<p>&nbsp;&nbsp;List:string;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p>declare&nbsp;module&nbsp;&#8216;DynamicWpWebPartStrings&#8217;&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;const&nbsp;strings:&nbsp;IDynamicWpWebPartStrings;<\/p>\n\n\n\n<p>&nbsp;&nbsp;export&nbsp;=&nbsp;strings;<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>In \u201c<strong>en-us.js<\/strong>\u201d replace the below code.<\/li><\/ul>\n\n\n\n<p>define([],&nbsp;function()&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;return&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&#8220;PropertyPaneDescription&#8221;:&nbsp;&#8220;Description&#8221;,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&#8220;BasicGroupName&#8221;:&nbsp;&#8220;Group&nbsp;Name&#8221;,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&#8220;DescriptionFieldLabel&#8221;:&nbsp;&#8220;Description&nbsp;Field&#8221;,<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&#8220;ListFieldLable&#8221;&nbsp;:&nbsp;&#8220;Lists&#8221;<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>});<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>In <strong>\u201c<\/strong><strong>DynamicWpWebPart.module.scss\u201d<\/strong> replace the below code.<\/li><\/ul>\n\n\n\n<p>@import&nbsp;&#8216;~@microsoft\/sp-office-ui-fabric-core\/dist\/sass\/SPFabricCore.scss&#8217;;<\/p>\n\n\n\n<p>.dynamicWp&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;.container&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;max-width:&nbsp;700px;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;margin:&nbsp;0px&nbsp;auto;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;box-shadow:&nbsp;0&nbsp;2px&nbsp;4px&nbsp;0&nbsp;rgba(0,&nbsp;0,&nbsp;0,&nbsp;0.2),&nbsp;0&nbsp;25px&nbsp;50px&nbsp;0&nbsp;rgba(0,&nbsp;0,&nbsp;0,&nbsp;0.1);<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;.row&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@include&nbsp;ms-Grid-row;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@include&nbsp;ms-fontColor-white;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;background-color:&nbsp;$ms-color-themeDark;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;padding:&nbsp;20px;<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;.column&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@include&nbsp;ms-Grid-col;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@include&nbsp;ms-lg10;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@include&nbsp;ms-xl8;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@include&nbsp;ms-xlPush2;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@include&nbsp;ms-lgPush1;<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;.title&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@include&nbsp;ms-font-xl;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@include&nbsp;ms-fontColor-white;<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;.subTitle&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@include&nbsp;ms-font-l;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@include&nbsp;ms-fontColor-white;<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;.description&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@include&nbsp;ms-font-l;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;@include&nbsp;ms-fontColor-white;<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;.button&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;\/\/&nbsp;Our&nbsp;button<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;text-decoration:&nbsp;none;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;height:&nbsp;32px;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;\/\/&nbsp;Primary&nbsp;Button<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;min-width:&nbsp;80px;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;background-color:&nbsp;$ms-color-themePrimary;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;border-color:&nbsp;$ms-color-themePrimary;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;color:&nbsp;$ms-color-white;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;\/\/&nbsp;Basic&nbsp;Button<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;outline:&nbsp;transparent;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;position:&nbsp;relative;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;font-family:&nbsp;&#8220;Segoe&nbsp;UI&nbsp;WestEuropean&#8221;,&#8221;Segoe&nbsp;UI&#8221;,-apple-system,BlinkMacSystemFont,Roboto,&#8221;Helvetica&nbsp;Neue&#8221;,sans-serif;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;-webkit-font-smoothing:&nbsp;antialiased;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;font-size:&nbsp;$ms-font-size-m;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;font-weight:&nbsp;$ms-font-weight-regular;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;border-width:&nbsp;0;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;text-align:&nbsp;center;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;cursor:&nbsp;pointer;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;display:&nbsp;inline-block;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;padding:&nbsp;0&nbsp;16px;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;.label&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font-weight:&nbsp;$ms-font-weight-semibold;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font-size:&nbsp;$ms-font-size-m;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height:&nbsp;32px;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;line-height:&nbsp;32px;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;margin:&nbsp;0&nbsp;4px;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;vertical-align:&nbsp;top;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;display:&nbsp;inline-block;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;.list&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;color:&nbsp;#333333;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;font-family:&nbsp;&#8216;Segoe&nbsp;UI&nbsp;Regular&nbsp;WestEuropean&#8217;,&nbsp;&#8216;Segoe&nbsp;UI&#8217;,&nbsp;Tahoma,&nbsp;Arial,&nbsp;sans-serif;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;font-size:&nbsp;14px;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;font-weight:&nbsp;normal;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;box-sizing:&nbsp;border-box;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;background-color:&nbsp;#ffffff;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;margin:&nbsp;10;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;padding:&nbsp;10;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;line-height:&nbsp;50px;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;list-style-type:&nbsp;none;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;box-shadow:&nbsp;0&nbsp;4px&nbsp;4px&nbsp;0&nbsp;rgba(0,&nbsp;0,&nbsp;0,&nbsp;0.2),&nbsp;0&nbsp;25px&nbsp;50px&nbsp;0&nbsp;rgba(0,&nbsp;0,&nbsp;0,&nbsp;0.1);<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>&nbsp;&nbsp;.listItem&nbsp;{<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;color:&nbsp;#333333;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;vertical-align:&nbsp;center;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;font-family:&nbsp;&#8216;Segoe&nbsp;UI&nbsp;Regular&nbsp;WestEuropean&#8217;,&nbsp;&#8216;Segoe&nbsp;UI&#8217;,&nbsp;Tahoma,&nbsp;Arial,&nbsp;sans-serif;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;font-size:&nbsp;14px;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;font-weight:&nbsp;normal;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;box-sizing:&nbsp;border-box;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;margin:&nbsp;0;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;padding:&nbsp;0;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;background-color:&nbsp;#ffffff;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;box-shadow:&nbsp;none;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;*zoom:&nbsp;1;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;padding:&nbsp;9px&nbsp;28px&nbsp;3px;<\/p>\n\n\n\n<p>&nbsp;&nbsp;&nbsp;&nbsp;position:&nbsp;relative;<\/p>\n\n\n\n<p>&nbsp;&nbsp;}<\/p>\n\n\n\n<p>}<\/p>\n\n\n\n<p><strong>Step-D:(Add the webpart): <\/strong><\/p>\n\n\n\n<p>After\nfollowing the above steps save all the files. In command prompt run the command\n<strong>\u201cgulp serve\u201d<\/strong>. The browser will open automatically and by clicking on the\n<strong>plus sign<\/strong> you can add the webpart <strong>DynamicWP. (Refer image-7).<\/strong><\/p>\n\n\n\n<p><strong>Image:7<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2021\/02\/7.png\" alt=\"\" class=\"wp-image-6364\"\/><\/figure>\n\n\n\n<p>The\nfinal webpart will appear as below image<strong>. (Refer image-8).<\/strong><\/p>\n\n\n\n<p><strong>Image:8<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2021\/02\/8.png\" alt=\"\" class=\"wp-image-6365\"\/><\/figure>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\">Keywords:<\/span><\/strong><\/p>\n\n\n\n<p>1-Create A Modern Web Part which will retrieve the Lists and Documents using SPFX.<br> 2-Retrieve lists and Documents Title using SPFX.<br> 3-How to retrieve lists and documents Title information within a modern Web Part.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this Blog, we are going to discuss about the creation of a new webpart using SPFx(No JavaScript framework).This webpart will represent the data of the corresponding site such as website Name ,website URL ,Total List Count &amp; retrieves the name of all custom list and documents. Let us get started \u2026 Step-A:(Creation of Webpart): Open Command Prompt. Go to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6415,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[],"class_list":["post-6357","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-sharepoint"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Create A Webpart Which will retrieve the List and Document using SPFx - Softree Technology<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Create A Webpart Which will retrieve the List and Document using SPFx - Softree Technology\" \/>\n<meta property=\"og:description\" content=\"In this Blog, we are going to discuss about the creation of a new webpart using SPFx(No JavaScript framework).This webpart will represent the data of the corresponding site such as website Name ,website URL ,Total List Count &amp; retrieves the name of all custom list and documents. Let us get started \u2026 Step-A:(Creation of Webpart): Open Command Prompt. Go to [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/\" \/>\n<meta property=\"og:site_name\" content=\"Softree Technology\" \/>\n<meta property=\"article:published_time\" content=\"2021-02-03T07:08:03+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Create A Webpart Which will retrieve the List and Document using SPFx - Softree Technology","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/","og_locale":"en_US","og_type":"article","og_title":"Create A Webpart Which will retrieve the List and Document using SPFx - Softree Technology","og_description":"In this Blog, we are going to discuss about the creation of a new webpart using SPFx(No JavaScript framework).This webpart will represent the data of the corresponding site such as website Name ,website URL ,Total List Count &amp; retrieves the name of all custom list and documents. Let us get started \u2026 Step-A:(Creation of Webpart): Open Command Prompt. Go to [&hellip;]","og_url":"https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/","og_site_name":"Softree Technology","article_published_time":"2021-02-03T07:08:03+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/#article","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/"},"author":{"name":"admin","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b"},"headline":"Create A Webpart Which will retrieve the List and Document using SPFx","datePublished":"2021-02-03T07:08:03+00:00","mainEntityOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/"},"wordCount":2852,"commentCount":0,"publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/#primaryimage"},"thumbnailUrl":"","articleSection":["SharePoint"],"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/","url":"https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/","name":"Create A Webpart Which will retrieve the List and Document using SPFx - Softree Technology","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/#primaryimage"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/#primaryimage"},"thumbnailUrl":"","datePublished":"2021-02-03T07:08:03+00:00","breadcrumb":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/#primaryimage","url":"","contentUrl":""},{"@type":"BreadcrumbList","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/create-a-webpart-which-will-retrieve-the-list-and-document-using-spfx\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/softreetechnology.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Create A Webpart Which will retrieve the List and Document using SPFx"}]},{"@type":"WebSite","@id":"https:\/\/softreetechnology.com\/blog\/#website","url":"https:\/\/softreetechnology.com\/blog\/","name":"Softree Technology","description":"Celebrating 10+ Years in SharePoint Consulting !","publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/softreetechnology.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en"},{"@type":"Organization","@id":"https:\/\/softreetechnology.com\/blog\/#organization","name":"Softree Technology","url":"https:\/\/softreetechnology.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","contentUrl":"https:\/\/softreetechnology.com\/blog\/wp-content\/uploads\/2023\/03\/cropped-white-logo-soft.png","width":844,"height":230,"caption":"Softree Technology"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b","name":"admin","image":{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/6fc78c8a7aa3fb0bf43c3b9a2e3962d7?s=96&d=mm&r=g","caption":"admin"},"sameAs":["https:\/\/softreeconsulting.com"],"url":"https:\/\/softreetechnology.com\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/6357","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/comments?post=6357"}],"version-history":[{"count":0,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/6357\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/media?parent=6357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/categories?post=6357"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/tags?post=6357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}