sharepoint online – 403 while trying to create a pnp privisioning template

Ok this site recently got switched form a modern site to a classic site and now I cannot use anything on the site to include turning on and off features with powershell. This is a sharepoint online site with office 365 permissions. I used to be able to use powershell on this site but now i am only getting a 403 error. Any help would be greatly appreciated.


I enter the URl and credentials without fail, but the minute I run

Get-PnPProvisioningTemplate -Out "example-Template.xml"


Set-PnPList -Identity "Some Library" -ForceCheckout $false

I will get the following error

  Set-PnPList : The remote server returned an error: (403) Forbidden.
At line:1 char:1
+ Set-PnPList -Identity "Some Library" -ForceCheckout $false
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : WriteError: (:) (Set-PnPList), WebException
    + FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Lists.SetList

I ran the log against it also and got this error in line one

 powershell.exe Error: 0 : 2020-09-16 08:03:52.1674 (OfficeDevPnP.Core) (0) (Error) ExecuteQuery threw following exception: System.Net.WebException: The remote server returned an error: (403) Forbidden.
   at System.Net.HttpWebRequest.EndGetResponse(IAsyncResult asyncResult)

sharepoint online – PnP Provisioning templates in PnP Js

XML-based PnP Provisioning templates are available to be consumed via SharePoint PnP PowerShell.

Question: Is there something similar for provisioning lists via JavaScript/TypeScript via pre-created template?

I really like the ability of creating the lists manually and saving them to a template later.

sharepoint enterprise – PnP copy .pst in SP site collection to new library in another site collection

We are dealing with SharePoint OnPrem / 2016 in this scenario.

I have a library template located in Site Collection 1, and need to create a library in site collection 2 using this centrally located .pst file in Site Collection 1.

Every example I’ve seen so far has the .pst in the same site collection, but our scenario the .pst will stay in site collection 1 so there’s one source of truth.

Is this an option? Does the .pst have to be in the same site collection where the new library is created if using PnP?

Please advise of any example where I could accomplish this.

Looking at this example currently, but it’s only dealing with a single site:

$ListName =”PnpDocumentTEST1″
Connect-PnPOnline -Url

$Context = Get-PnPContext
$Web = $Context.Site.RootWeb
$ListTemplates = $Context.Site.GetCustomListTemplates($Web)

$ListTemplate = $ListTemplates | where { $_.InternalName -eq $ListTemplateInternalName }

if ($ListTemplate -eq $null)
Throw (System.Exception) “Template not found”

$ListCreation = New-Object Microsoft.SharePoint.Client.ListCreationInformation
$ListCreation.Title = $ListName
$ListCreation.ListTemplate = $ListTemplate



sharepoint online – New PnP Team site PowerShell does not add Owners

I was trying to create new Site collection in my SharePoint online tenant with O365 group. So I have come across following commands from PnP PowerShell.

New-PnPSite allows us to create O365 group with Site Collection. So I was trying to create multiple site collection from CSV. That CSV does contain information about Owners of the site. So when I try following command after authenticating to PnPOnline single line code works as below:

New-PnPSite -Type TeamSite -Title "0ABC Test" -Alias "0abctest" -Description "some desc" -Owners "","","" -Lcid 1033

Above code will create new O365 group and also adds those user mentioned as a owner of the group. This command will also create site collection.

But when I try it by reading Owners from CSV file as below (Sample CSV):

122 Dev Test,122DevProject,,"";"";"",Private

new site never adds owner, it always shows empty.
Below is my PS Code:

foreach ($row in $table) #$table is my CSV object
    (array)$owners = $row.OWNERS.split(";")
    (string)$stringOwners = $null
    $stringOwners = '"{0}' -F ($owners -join '",')
    $stringOwners = $stringOwners.Replace('""', '"')
    $stringOwners = $stringOwners.Trim(',')

    New-PnPSite -Type TeamSite -Title $row.DisplayName -Alias $row.Alias -Description $row.DisplayName -Owners $stringOwners -Lcid 1033

So my question is how can we add multiple user for New-PnPSite reading owners from CSV file. Is this really possible? Am I missing something here?

Any help would be much appreciated.

spfx – How to Retrieve data from SharePoint list via PnP JS Core and CAML Query

You can get items from SharePoint list using a CAML Query.

Sample Code:

import { ICamlQuery } from "@pnp/sp/lists";

// build the caml query object (in this example, we include Title field and limit rows to 5)
const caml: ICamlQuery = {
    ViewXml: "<View><ViewFields><FieldRef Name='Title' /></ViewFields><RowLimit>5</RowLimit></View>",

// get list items
const r = await list.getItemsByCAMLQuery(caml);

// log resulting array to console


  1. Get list items using a CAML Query

powershell – Missing Lookup fields in Sharepoint Online Pnp

Basically, I have three lists: Users, Agencies, and Office. The Users list has a Agency lookup field to the Agencies list and an Office lookup field to the Office list. The lists in SharePoint displays all the fields.

When I use Get-PnpField to display fields in my list I all the fields, however, when I use Get-PnpListItem.FieldValues fields are missing. In my case it’s lookup fields, that look up items in other SharePoint lists. There is a lookup field “Dept” in my Users list that does work, but I can’t seem to find, let alone manipulate, the Agency and Office lookup fields .

I’ve read there may be limits on the number of lookup fields in a SharePoint List, but it is working in sharepoint and I’d rather number delete anything until I know.

**$sd = Get-PnPList -Identity 'Directory'
$Items = Get-PnPListItem  -List $sd.title

Get-PnPField -List $sd.Title**

Title                      InternalName               Id
-----                      ------------               --
Title                      Title                      fa564e0f-0c70-4ab9-b863-0177e6ddd247
Staff                      Staff                      20c8bcd5-371e-4050-866a-3790bc34ed11
User                       User                       15e8758a-f21b-47d5-a693-077c4e299b22
Order                      Order0                     12ef08a6-adc7-4f73-adb8-79a87f39cef5
Phone                      Phone                      5c50bd17-babb-4295-8dfb-7dff60ea4212
OtherPhone                 OtherPhone                 2e84f778-d66e-4a68-9759-2cd290e450bc
Fax                        Fax                        1d597500-0376-4bab-b51a-fedb47210e7b
Primary                    Primary                    5354a36c-a7e0-426a-a2ef-6f99187679bb
Email                      Email                      23ea738b-444d-41d8-9440-35163f9cef3c
DisplayName                DisplayName                ea6293ce-f506-4e5d-9646-bc09449cccb5
Dept                       Dept                       072c559e-f7d2-4431-9694-c4bc5ac36f3d
Title                      LinkTitleNoMenu            bc91a437-52e7-49e1-8c4e-4698904b2b6d
Title                      LinkTitle                  82642ec8-ef9b-478f-acf9-31f7d45fbc31
Title                      LinkTitle2                 5f190d91-3dbc-4489-9878-3c092caf35b6
_Order                     Order                      ca4addac-796f-4b23-b093-d2a3f65c0774
CtName                     Dept_x003a_CtName          91692227-637b-483d-ab0a-205dc46c338c
DeptName                   Dept_x003a_DeptName        6276ec5a-3883-483a-a0ca-5c3c1116e02c
FaxNo                      Dept_x003a_FaxNo           77effaed-56e5-4b90-8604-cf3e150d4776
Mail                       Mail                       91c75fc5-b77f-435a-929d-cd43b42f8545
FirstName                  FirstName                  924a9ab5-11de-4f4a-8be8-25face191f9a
LastName                   LastName                   d3170352-903b-411b-88d1-86ffaa9eb13c
Rname                      Rname                      28194977-e009-4599-af7d-a5a2ad627153
Temp                       Temp                       cd0d968a-1875-42c9-91d9-16a152cd6e14
Username                   Username                   b8d6c2b5-1960-45a9-82fb-695fbc0d4326
FullName                   FullName                   8f204fcd-850b-4b0a-af5c-ea565341946a
WorkTitle                  WorkTitle                  461da2e8-8630-420c-b196-b305ea4ffd18
WorkEMail                  WorkEMail                  a1928f03-6a5d-48ed-84b1-d9323f2e176a
WorkPhone                  WorkPhone                  0b5749da-6560-4a79-a61c-c3bbdd78ea89
GivenName                  GivenName                  88c5af5d-d37b-4c52-bee0-c2e360208da2
SurName                    SurName                    11b91496-e268-4521-b16c-0251b8d81b13
Photo                      Photo                      15a33eb0-47d7-4f71-a402-73541e4c98f8
Account                    Account                    a4cb2a6e-19b5-439f-8fcb-4572a1fd0801
ListOrder                  ListOrder                  44ba03b4-ae94-4072-9a8c-43a2d5d8f273
Office                     Office                     0da809c3-fd0c-4986-b942-f1be304eefe3
Agency                     Agency                     d2d50ea1-7f38-4e65-9660-5a6866eed866
ID                         ID                         1d22ea11-1e32-424e-89ab-9fedbadb6ce1


Key                       Value
---                       -----
Title                     Office Clerical Assistant (PT)
Staff                     Microsoft.SharePoint.Client.FieldUserValue
User                      jsmith
Order0                    1
Phone                     111-111-1111
Primary                   True
Dept                      Microsoft.SharePoint.Client.FieldLookupValue
ContentTypeId             0x010015D03C0F56A8604C9C3963F2DEA75564
Order                     12600
Dept_x003a_CtName         Microsoft.SharePoint.Client.FieldLookupValue
Dept_x003a_DeptName       Microsoft.SharePoint.Client.FieldLookupValue
Setiteml                  5
Dept_x003a_FaxNo          Microsoft.SharePoint.Client.FieldLookupValue
FirstName                 Jon
LastName                  Smith
Rname                     Smith, Jon
Temp                      A
FullName                  Microsoft.SharePoint.Client.FieldUserValue
WorkTitle                 Microsoft.SharePoint.Client.FieldUserValue
WorkEMail                 Microsoft.SharePoint.Client.FieldUserValue
WorkPhone                 Microsoft.SharePoint.Client.FieldUserValue
GivenName                 Microsoft.SharePoint.Client.FieldUserValue
SurName                   Microsoft.SharePoint.Client.FieldUserValue
Photo                     Microsoft.SharePoint.Client.FieldUserValue
ListOrder                 016000020000100
ID                        126

Thanks for any guidance you may offer.

pnp powershell – “Get-PnPProperty: Cannot convert the “Microsoft.SharePoint.Client.Folder” to type “Microsoft.SharePoint.Client.ClientObject”

When we run the below command on Powershell 7, to fetch detail of folder in the sharepoint.

Get-PnPProperty -ClientObject "david onedve/3200 in 400mb/Level 2" -Property Files, Folders

we are getting below error:
Get-PnPProperty: Cannot bind parameter ‘ClientObject’. Cannot convert the “Microsoft.SharePoint.Client.Folder” value of type “Deserialized.Microsoft.SharePoint.Client.Folder” to type “Microsoft.SharePoint.Client.ClientObject”.

However, its run successfully on Powershell 5.1

sharepoint online – PNP Modern Search with Live Persona Card Sample

Okay lets say you would have a card style layout
go to your search webpart settings – on page 2 of the settings
enter following values into Selected Properties


On page 3 of the search webpart settings select the “Results layout”


Then edit the template and put following template for card layout into the editor box

    <content id="template">

    /* Insert your CSS overrides here */
    #pnp-modern-search_{{@root.instanceId}} {
    /* Insert your CSS overrides here */
    .livepersona-themePrimary a {
        color: {{ @root.themeVariant.palette.themePrimary }};

    .template_livepersona-card {
        margin-right: 15px;
        -webkit-box-flex: 0;
        -ms-flex: 0 0 345px;
        flex: 0 0 345px;
    .livepersona-info {
        color: {{@root.themeVariant.palette.neutralPrimary}};
    .live-persona-card {
        background-color: {{@root.themeVariant.palette.white}}; 
        border: 1px solid {{@root.themeVariant.palette.neutralLight}};
        box-sizing: border-box;
        max-width: 320px;
        min-width: 206px;
        position: relative;
        margin-bottom: 15px;
        user-select: none;
    .live-persona-card:hover {
        cursor: pointer;
        border-color: {{@root.themeVariant.palette.neutralTertiaryAlt}} !important;
    .livepersona-card-headercontainer {
        border-bottom: 1px solid {{@root.themeVariant.palette.neutralLight}};
        position: relative;
        background-color: {{@root.themeVariant.palette.white}};
        overflow: hidden;
    (dir="ltr") .livepersona-ContainerCard-title {
        text-align: left;
    .livepersona-ContainerCard-title {
        font-size: 17px;
        font-weight: 300;
        font-weight: 400;
        width: 100%;
        line-height: 17px;
        margin-top: 30px;
        padding: 0 12px;
        color: {{@root.themeVariant.palette.themePrimary}};       
        -webkit-animation-name: ms-fadeIn;
        animation-name: ms-fadeIn;
        -webkit-animation-duration: 267ms;
        animation-duration: 267ms;
        -webkit-animation-timing-function: cubic-bezier(.1,.9,.2,1);
        animation-timing-function: cubic-bezier(.1,.9,.2,1);
        -webkit-animation-delay: 50ms;
        animation-delay: 50ms;
        -webkit-box-sizing: border-box;
        box-sizing: border-box;
    .livepersona-ContainerCard-subTitle {
        padding: 0px 12px;
        font-size: 14px;
        font-weight: 400;
        padding-top: 5px;
        color: {{@root.themeVariant.palette.neutralPrimary}};
        -webkit-animation-name: ms-fadeIn;
        animation-name: ms-fadeIn;
        -webkit-animation-duration: 167ms;
        animation-duration: 167ms;
        -webkit-animation-timing-function: cubic-bezier(.1,.9,.2,1);
        animation-timing-function: cubic-bezier(.1,.9,.2,1);
        -webkit-animation-delay: .25s;
        animation-delay: .25s;
    .livepersona-ContainerCard-subTitle strong, .livepersona-ContainerCard-subTitle b
        color: {{@root.themeVariant.palette.themePrimary}};
    .livepersona-card-header-normal {
        border-bottom: 2px solid {{@root.themeVariant.palette.neutralLight}};
    .livepersona-card-header-normal {
        position: relative;
        width: 100%;
        padding-top: 0px;
        height: auto;
        cursor: pointer;
        background-color: {{@root.themeVariant.palette.white}};
        display: block;
    .livepersona-card-titletopfix {
        margin-top: 10px;
    .livepersona-margin-10px {
        margin: 10px
    .livepersona-image {
        font-family: "Segoe UI", "Segoe UI Web (West European)", "Segoe UI", -apple-system, BlinkMacSystemFont, "Roboto", "Helvetica Neue", sans-serif;
        font-size: 14px;
        font-weight: 400;
        overflow: hidden;
        animation-duration: 0.367s;
        animation-timing-function: cubic-bezier(0.1, 0.25, 0.75, 0.9);
        margin-right: 10px;
        top: 0px;
        left: 0px;
        width: 100px;
        height: 100px;
        border: 0px none;
        border-radius: 50%;
        perspective: 1px;

    .livepersona-image img {
        display: block;
        opacity: 1;
        width: 100%;
        height: 100%;
        object-fit: cover;
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);

    .livepersona-flex-container {
        display: -ms-flexbox;
        display: -webkit-flex;
        display: flex;
        -webkit-flex-direction: row;
        -ms-flex-direction: row;
        flex-direction: row;
        -webkit-flex-wrap: nowrap;
        -ms-flex-wrap: nowrap;
        flex-wrap: nowrap;
        -webkit-justify-content: flex-start;
        -ms-flex-pack: start;
        justify-content: flex-start;
        -webkit-align-content: stretch;
        -ms-flex-line-pack: stretch;
        align-content: stretch;
        -webkit-align-items: flex-start;
        -ms-flex-align: start;
        align-items: flex-start;

    .livepersona-flex-item:nth-child(1) {
        -webkit-order: 0;
        -ms-flex-order: 0;
        order: 0;
        -webkit-flex: 0 1 auto;
        -ms-flex: 0 1 auto;
        flex: 0 1 auto;
        -webkit-align-self: stretch;
        -ms-flex-item-align: stretch;
        align-self: stretch;

    .livepersona-flex-item:nth-child(2) {
        -webkit-order: 0;
        -ms-flex-order: 0;
        order: 0;
        -webkit-flex: 1 1 auto;
        -ms-flex: 1 1 auto;
        flex: 1 1 auto;
        -webkit-align-self: stretch;
        -ms-flex-item-align: stretch;
        align-self: stretch;

    .livepersona-primaryText {
        white-space: nowrap;
        color: {{ @root.themeVariant.palette.neutralPrimary }};
        font-weight: 300;
        font-size: 21px;

    <div class="template_root">
        {{#if @root.hasPrimaryOrSecondaryResults}} 
            <div class="template_defaultCard">
                {{#if showResultsCount}}
                <div class="template_resultCount">
                    <label class="ms-fontWeight-semibold">{{getCountMessage @root.paging.totalItemsCount keywords}}</label>
                <div class="document-card-container">
                    {{#each items as |item|}}
                    <div class="document-card-item">
                        {{#> resultTypes item=item}}
                            {{!-- The block below will be used as default item template if no result types matched --}}
                            {{#eq item.contentclass 'STS_ListItem_851'}}
                                <pnp-video-card data-item="{{JSONstringify item}}" data-fields-configuration="{{JSONstringify @root.documentCardFields}}" data-enable-preview="{{@root.enablePreview}}" data-show-file-icon="{{@root.showFileIcon}}" data-is-compact="{{@root.isCompact}}"></pnp-video-card>
                                <pnp-document-card data-item="{{JSONstringify item}}" data-fields-configuration="{{JSONstringify @root.documentCardFields}}" data-enable-preview="{{@root.enablePreview}}" data-show-file-icon="{{@root.showFileIcon}}" data-is-compact="{{@root.isCompact}}"></pnp-document-card>
            {{#if @root.paging.showPaging}}
            {{#unless showBlank}}
                <div class="template_noResults">{{@root.strings.NoResultMessage}}</div>

<content id="placeholder">   
    <div class="placeholder_root">
        <div class="template_defaultCard">
            {{#if showResultsCount}}
                <div class="template_resultCount">
                    <span class="shimmer line" style="width: 20%"></span>
            <div class="document-card-container"> 
                {{#times @root.paging.totalItemsCount}}
                    <div class="document-card-item">
                        <pnp-document-card-shimmers data-is-compact="{{@root.isCompact}}"></pnp-document-card-shimmers>

then configure the “Result Types” by clicking on the “Edit Result Types” button
Add a new row and enter following values

Managed Property = contentclass
Operator = Contains
Condition Value = SPSPeople

And in the “Inline template” editor box enter following code

    <div class="template_livepersona-card">

    <div class="livepersona-card-item">

            <div tabindex="0" data-is-focusable="true" role="button"
                class="ms-DocumentCard ms-DocumentCard--actionable live-persona-card">

                {{#with (split AccountName '|')}}
                <div style="position: relative; height: 100%;">

                    <div aria-label="{{../FirstName}} {{../LastName}}" class="livepersona-card-header-normal"
                        data-focusable-context="ActivityCards" data-is-focusable="true" data-interception="propagate"
                        data-nested-context="Card" data-sp-sitetype-hint="Comm" 
                        title="{{../FirstName}} {{../LastName}}" tabindex="-1">

                        <div title="{{../FirstName}} {{../LastName}}">

                        <div class="ms-DocumentCardPreview livepersona-card-headercontainer">
                            <div class="livepersona-flex-container">
                                <div class="livepersona-flex-item ms-Persona-coin ms-Persona--size100">
                                    <div class="ms-Persona-imageArea">
                                        <div class="ms-Image ms-Persona-image livepersona-image livepersona-margin-10px" style="width: 100px; height: 100px;">
                                            <pnp-live-persona data-upn="{{(2)}}" data-disableHover="false" data-template="<img class='img-preview ms-Image-image is-loaded ms-Image-image--cover ms-Image-image--landscape is-fadeIn' src="{{(2)}}"' alt=''/>" />
                                <div class="livepersona-flex-item">
                                    <div class="livepersona-primaryText livepersona-themePrimary livepersona-margin-10px">
                                        <a target="_blank" data-interception="off" 
                                            <pnp-live-persona data-upn="{{(2)}}" data-disableHover="false" data-template="{{../FirstName}} {{../LastName}}" />
                                    <a target="_blank" data-interception="off"  class="livepersona-info"
                                    <pnp-live-persona data-upn="{{(2)}}" data-disableHover="false" data-template="
                                        {{#if ../JobTitle}}
                                                <i class='ms-Icon ms-Icon--Work' aria-hidden='true'></i> {{../JobTitle}}<br />
                                        {{#if ../Department}}
                                                <i class='ms-Icon ms-Icon--Group' aria-hidden='true'></i> {{../Department}}<br />
                                        {{/if}}" />

                            <a aria-label="{{../FirstName}} {{../LastName}}" 
                            data-focusable-context="ActivityCards" data-is-focusable="true"
                            data-nested-context="Card" data-sp-sitetype-hint="Comm" href="{{getUrl item}}"
                            target="_blank" data-interception="off" title="{{../FirstName}} {{../LastName}}" tabindex="-1">
                                <div class="livepersona-ContainerCard-title livepersona-card-titletopfix  ">
                                <div class="livepersona-ContainerCard-subTitle livepersona-themePrimary">
                                        {{#if ../WorkPhone}}
                                            <span class="persona-link ">
                                                <a href="tel:{{replace (replace (replace ../WorkPhone "-" "") "/" "") " " ""}}" title="Telephone">
                                                    <i class="ms-Icon ms-Icon--Phone" aria-hidden="true"></i>&nbsp;
                                                </a><br />
                                        {{#if ../WorkEmail}}
                                            <span class="persona-link ">
                                                <a href="mailto:{{../WorkEmail}}" title="Email">
                                                    <i class="ms-Icon ms-Icon--Mail" aria-hidden="true"></i>&nbsp;
                                            </span><br />
                                            <span class="persona-link ">
                                                <a target="_blank" data-interception="off" href="{{../FirstName}}+{{../LastName}}&searchpage=1&searchview=people&v=search" title="Delve">
                                                    <i class="ms-Icon ms-Icon--DelveLogo" aria-hidden="true"></i>&nbsp;
                                                    Find this person in Delve

That should render some nice persona cards (maybe needs some CSS styling) and when hovering with the mouse over a person the live persona card shows up.

sharepoint online – crud operation using bootstrap with pnp library

Check if the request has this problem.
enter image description here

You could know how to solve this problem here:

My test code for your reference:

import { Version } from '@microsoft/sp-core-library';
import {
} from '@microsoft/sp-property-pane';
import { BaseClientSideWebPart } from '@microsoft/sp-webpart-base';
import { escape } from '@microsoft/sp-lodash-subset';
import {Web } from 'sp-pnp-js'

import styles from './NoframeworkspfxWebPart.module.scss';
import * as strings from 'NoframeworkspfxWebPartStrings';
import { SPHttpClient, SPHttpClientResponse, SPHttpClientConfiguration,ISPHttpClientOptions } from '@microsoft/sp-http'; 
export interface INoframeworkspfxWebPartProps {
  description: string;
var moment:any = require('moment-timezone');
export default class NoframeworkspfxWebPart extends BaseClientSideWebPart <INoframeworkspfxWebPartProps> {

  public render(): void {
    //let cssURL = "";
    this.domElement.innerHTML = `
    <div class="panel panel-info">
        <div class="panel-heading"><h3 class="panel-title"><strong>Sign In </strong></h3></div>
        <div class="panel-body">
            <div class="form-group">
              <div class="row" hidden>
                <div class="col-md-12">
                  <label for="empID" class="control-label">Enter Employee ID</label>
                <div class="col-sm-8">
                  <input type="text" class="form-control" id="empID" placeholder="Enter ID">
                <div class="col-sm-2">
                  <button type="submit" class="btn btn-primary" id="btnRead">Read Details</button>
            <div class="form-group">
                <label for="empName">Employee Name</label>
                <input type="text" class="form-control" id="empName" placeholder="Enter email">
            <div class="form-group">
                <label for="gender">Gender</label>
                <input type="text" class="form-control" id="empGender" placeholder="Password">
            <div class="form-group">
                <label for="empDesignation">Designation</label>
                <input type="text" class="form-control" id="empDesignation" placeholder="Enter email">
            <div class="form-group">
                <label for="empDepartment">Department</label>
                <input type="text" class="form-control" id="empDepartment" placeholder="Password">
            <div class="form-group">
                <label for="empLocation">Location</label>
                <input type="text" class="form-control" id="empLocation" placeholder="Enter email">
            <div class="form-group">
                <label for="empEmail">Email</label>
                <input type="text" class="form-control" id="empEmail" placeholder="Password">
            <button type="submit" id="btnSubmit" class="btn btn-sm btn-primary">Submit</button>
            <div id="divStatus"></div>
            <div id="spListData"></div>

  private _bindEvents(): void {
    this.domElement.querySelector('#btnSubmit').addEventListener('click', () => { this.addListItem(); });

  private addListItem(): void {
    var employeeName = document.getElementById("empName")("value");
    var employeeGender = document.getElementById("empGender")("value");
    var employeeDesignation = document.getElementById("empDesignation")("value");
    var employeeDepartment = document.getElementById("empDepartment")("value");
    var employeeLocation = document.getElementById("empLocation")("value");
    var employeeEmail = document.getElementById("empEmail")("value");
    let web = new Web(this.context.pageContext.web.absoluteUrl);
      Title: employeeName,
      // Gender: employeeGender,
      // Designation: employeeDesignation,
      // Department: employeeDepartment,
      // Location: employeeLocation,
      // Email: employeeEmail
    }).then(r => {

  protected get dataVersion(): Version {
  return Version.parse('1.0');

  protected getPropertyPaneConfiguration(): IPropertyPaneConfiguration {
  return {
    pages: (
        header: {
          description: strings.PropertyPaneDescription
        groups: (
            groupName: strings.BasicGroupName,
            groupFields: (
              PropertyPaneTextField('description', {
                label: strings.DescriptionFieldLabel

Test result:
enter image description here

Pnp PowerShell to hide the SharePoint list

I’ve a list called “A” in root SharePoint online site collection and it have no. of columns. One of the column, say “xyz” is type of “Hyperlink” field which contains the Sub Site URL with display text, like that I’ve total of 30 list items in the list “A”, that means total I will be having 30 sub site URL’s. And, each sub site will have the list name called “Revenue”.

Now my requirement is, I need to iterate through each entry in the list “A” of site collection, and check if the “Hyperlink” field have the site URL. If it has site URL, then I need to hide the list called “Revenue” in that particular sub site using Pnp PowerShell script.

Below is my basic code to hide the list. Could you please help on how to iterate through the list and hide the list “Revenue” if it has the site URL in the list column “xyz”?

$listName = "LIST NAME"
$site = ""

Connect-PnPOnline -Url $site -UseWebLogin
Set-PnPList -Identity $listName -Hidden $true

Thank you!!