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,
    – Grzegorz Z
    Mar 3, 2021 at 11:58
  • UserColumn is the data returned from your API. Example UserColumn = res.d.data[0]["UsersField"] Mar 3, 2021 at 18:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.