0

I have writen a URL for REST API:

/_api/web/lists/GetByTitle('KomorkaOrganizacyjna')/Items(1)?$select=Title,MPK,Skrot,Informacje_o_komorce,Prze_x0142_o_x017c_ony/Title,Kierownik/Title,Lista_Pracownikow/Title&$expand=Prze_x0142_o_x017c_ony/Id,Kierownik/Id,Lista_Pracownikow/Id

I have got a problem how to get value to sharepoint code. I need a user values. And what to see it at the HTML code.

I have got in rest what I need names of users, but i can't give them to the put them to the HTML How could I get them ?enter image description here

1 Answer 1

0

If I Understand correctly, We cant get directly Users as single value, SharePoint return as array of user objects.

We need to get the Title of each User object from Users Column and then join them.

let result = UserColumn.map(user => user.Title);
let UsersHTML = result.join(", ")
2
  • But how declare user column ? This is Sharepoint Online, Commented Mar 3, 2021 at 11:58
  • UserColumn is the data returned from your API. Example UserColumn = res.d.data[0]["UsersField"] Commented Mar 3, 2021 at 18:38

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.