0

I need to find out the username or name of a principalId number that I'm returning from a REST call which get's role assignments currently on a SharePoint list item.

I understand it may involve:

const r = await sp.web.lists.getByTitle('MyList').items.getById(theItem).roleAssignments() 

There is no documentation that explains how to do this that I have found.

NightTom
  • 418
  • 15
  • 37

1 Answers1

0

Answered my own question again:

const assignments = await sp.web.lists.getByTitle('MyList').items.getById(theItem).roleAssignments();

const expanded = assignments[0].PrincipalId;

console.log(expanded, 'expanded');
NightTom
  • 418
  • 15
  • 37