A Complete Guide to Getting and Setting Fields Value using PnP JS in SPFx

πŸš€ This article has moved!

Please visit the updated version here:

πŸ‘‰ Go to Updated Article

8 thoughts on “A Complete Guide to Getting and Setting Fields Value using PnP JS in SPFx

  1. Can you made this post for Create operation?

    In PnP SPFx Control React, the PeoplePicker provided selected people data like this:

    [{
    id: “i:0#.f | membership | person1@someurl.com
    imageInitials: “P1”
    mageUrl: “https://someurl.com/sites/MyName/_layouts/15/userphoto.aspx?
    accountname=person1%40someurl.com&size=M”
    oginName: “i:0#.f | membership | person1@someurl.com
    optionalText: “”
    secondaryText: “person1@someurl.com”
    tertiaryText: “”
    text: “Person 1”
    }]

    Is there any way to Create or Update an item without using Person/Group’s id?

    Liked by 1 person

  2. When setting a multi value choice column the code you provided above no longer works. Instead of:

    Locations: { results: multiChoice }

    Just assign the string array directly i.e.)

    Locations: multiChoice

    Like

  3. When setting a single value MMS column, the Β Β "__metadata": { "type": "SP.Taxonomy.TaxonomyFieldValue" } element is no longer needed and will result in an error if left in.

    Like

Comments