{"id":6220,"date":"2020-08-18T13:37:00","date_gmt":"2020-08-18T13:37:00","guid":{"rendered":"https:\/\/www.softreetechnology.com\/?p=6220"},"modified":"2020-08-18T13:37:00","modified_gmt":"2020-08-18T13:37:00","slug":"how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp","status":"publish","type":"post","link":"https:\/\/softreetechnology.com\/blog\/sharepoint\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/","title":{"rendered":"How to Create a New SharePoint List and Adding a  Choice Field in it By Using PNP"},"content":{"rendered":"\n<p>Now a days there is high demand in PNP as there is less execution of codes and all is done by executing a number of commands in PNP.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Procedure:<\/li><li>Connect to the site:<\/li><\/ul>\n\n\n\n<p>At\nfirst connect to the site where you want to create a new list and choice field\nof it.<\/p>\n\n\n\n<p>To connect to the SharePoint list you must run the following PNP command as given below.<\/p>\n\n\n\n<p style=\"text-align:left\">$credentials = Get-Credential<br>$siteurl = &#8220;https:\/\/softreetechss.sharepoint.com&#8221;<br>Connect-PnPOnline -Url $siteurl -Credentials $credentials<\/p>\n\n\n\n<p>In the Place of siteurl give\nthe url of your site.<\/p>\n\n\n\n<p>After executing the command you\nwill be prompted for the credentials of the site as shown below. <\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/08\/5.png\" alt=\"\" class=\"wp-image-6221\"\/><\/figure>\n\n\n\n<p>After providing the credentials\nof your site, you can create a new list in your site.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Create a newlist:<\/li><\/ul>\n\n\n\n<p>To create a new list in your\nsite you should run the following command as given below.<\/p>\n\n\n\n<p>Add-PnPField -List &#8220;Demo4 Test&#8221;\n-DisplayName &#8220;Demo4&#8221; &nbsp;&nbsp;&nbsp; <\/p>\n\n\n\n<p>After\nrunning the script you will notice that the newlist have been created in your\nsite as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/08\/1-1.png\" alt=\"\" class=\"wp-image-6222\"\/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Add Choice field in newly created list:<\/li><\/ul>\n\n\n\n<p>To create the new choice field in the newly created list you should run the following command as given below.<\/p>\n\n\n\n<p>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nAdd-PnPField -List &#8220;Demo4Test&#8221; -DisplayName &#8220;Language&#8221; -Type Choice &nbsp;-AddToDefaultView -Choices &#8220;English&#8221;,&#8221;French&#8221;,&#8221;Dutch&#8221;\n\n\n\n<\/p>\n\n\n\n<p>After running the\nscript you will notice that the new field is created in your list as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/08\/2-1.png\" alt=\"\" class=\"wp-image-6223\"\/><\/figure>\n\n\n\n<p>After creating the field it is time to use those choices which we added through the command and those choices are 1. English, 2. French, 3. Dutch.<\/p>\n\n\n\n<p>To use these choices you need to add an item in the newly created list and you can see these choices as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/08\/3-1.png\" alt=\"\" class=\"wp-image-6224\"\/><\/figure>\n\n\n\n<p>Now\nyou can select any of these choices as per your requirement and then click on\nsave.<\/p>\n\n\n\n<p>After\nthat you will see that the new item with its selected field is ready as shown below.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/08\/4-1.png\" alt=\"\" class=\"wp-image-6225\"\/><\/figure>\n\n\n\n<p><strong><span style=\"text-decoration: underline;\"><em>Conclusion:<\/em><\/span><\/strong><br>Hello to all dear readers, in this blog I have explained to create a new list and adding a choice field in it by using PNP. Hope you will enjoy it. <\/p>\n\n\n\n<p><strong><em><span style=\"text-decoration: underline;\">Keywords<\/span><\/em><\/strong>:<br>* SharePoint Online<br>* SharePoint List<br>* Choice Field<br>* PNP<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now a days there is high demand in PNP as there is less execution of codes and all is done by executing a number of commands in PNP. Procedure: Connect to the site: At first connect to the site where you want to create a new list and choice field of it. To connect to the SharePoint list you must [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[],"class_list":["post-6220","post","type-post","status-publish","format-standard","hentry","category-sharepoint"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Create a New SharePoint List and Adding a Choice Field in it By Using PNP - 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\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create a New SharePoint List and Adding a Choice Field in it By Using PNP - Softree Technology\" \/>\n<meta property=\"og:description\" content=\"Now a days there is high demand in PNP as there is less execution of codes and all is done by executing a number of commands in PNP. Procedure: Connect to the site: At first connect to the site where you want to create a new list and choice field of it. To connect to the SharePoint list you must [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/softreetechnology.com\/blog\/sharepoint\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/\" \/>\n<meta property=\"og:site_name\" content=\"Softree Technology\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-18T13:37:00+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=\"2 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create a New SharePoint List and Adding a Choice Field in it By Using PNP - 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\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/","og_locale":"en_US","og_type":"article","og_title":"How to Create a New SharePoint List and Adding a Choice Field in it By Using PNP - Softree Technology","og_description":"Now a days there is high demand in PNP as there is less execution of codes and all is done by executing a number of commands in PNP. Procedure: Connect to the site: At first connect to the site where you want to create a new list and choice field of it. To connect to the SharePoint list you must [&hellip;]","og_url":"https:\/\/softreetechnology.com\/blog\/sharepoint\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/","og_site_name":"Softree Technology","article_published_time":"2020-08-18T13:37:00+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/#article","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/"},"author":{"name":"admin","@id":"https:\/\/softreetechnology.com\/blog\/#\/schema\/person\/98740297642f06debccdcee2de84086b"},"headline":"How to Create a New SharePoint List and Adding a Choice Field in it By Using PNP","datePublished":"2020-08-18T13:37:00+00:00","mainEntityOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/"},"wordCount":372,"commentCount":0,"publisher":{"@id":"https:\/\/softreetechnology.com\/blog\/#organization"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/#primaryimage"},"thumbnailUrl":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/08\/5.png","articleSection":["SharePoint"],"inLanguage":"en","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/softreetechnology.com\/blog\/sharepoint\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/","url":"https:\/\/softreetechnology.com\/blog\/sharepoint\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/","name":"How to Create a New SharePoint List and Adding a Choice Field in it By Using PNP - Softree Technology","isPartOf":{"@id":"https:\/\/softreetechnology.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/#primaryimage"},"image":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/#primaryimage"},"thumbnailUrl":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/08\/5.png","datePublished":"2020-08-18T13:37:00+00:00","breadcrumb":{"@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/#breadcrumb"},"inLanguage":"en","potentialAction":[{"@type":"ReadAction","target":["https:\/\/softreetechnology.com\/blog\/sharepoint\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/"]}]},{"@type":"ImageObject","inLanguage":"en","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/#primaryimage","url":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/08\/5.png","contentUrl":"https:\/\/www.softreetechnology.com\/wp-content\/uploads\/2020\/08\/5.png"},{"@type":"BreadcrumbList","@id":"https:\/\/softreetechnology.com\/blog\/sharepoint\/how-to-create-a-new-sharepoint-list-and-adding-a-choice-field-in-it-by-using-pnp\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/softreetechnology.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Create a New SharePoint List and Adding a Choice Field in it By Using PNP"}]},{"@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\/6220","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=6220"}],"version-history":[{"count":0,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/posts\/6220\/revisions"}],"wp:attachment":[{"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/media?parent=6220"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/categories?post=6220"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/softreetechnology.com\/blog\/wp-json\/wp\/v2\/tags?post=6220"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}