Hi,
We are trying to make a button on a form that when clicked, adds the current user on Sharepoint to a list. The following code is what we've used for the onclick() attribute of the button.
var currentUser = _spPageContextInfo.userDisplayName;
var list = pnp.sp.web.lists.getByTitle("List%20Name");
list.items.add({Title: currentUser});
return fd.save();
However this isn't working, what are we doing wrong?
Thanks,