Trying to add list item using pnp with a choice field

Hi,

I am trying to create a new form using sp.web.lists.getByTitle(‘MyList’).items.add. The new item gets added and all fields are properly added except the choice field. I have tried

Team: 1

OR

Team : “HR”

in the items.add code, but neither are giving me a value in the new record for the Team field.

Thanks in advance for your assistance, Rhonda

Dear @rhonda,
If it’s a choice field, and not a lookup field, it should be populated with just a text string, like Single Line Text field. Make sure field’s Name is correct, and make sure the option is valid, and it should work.

Post here how it goes!

1 Like