Share via

How to return value from getUserProperties or executeQueryAsync

Sevil Red 101 Reputation points
2021-02-14T18:45:56.197+00:00

Good day,

I embedded the script on SharePoint view. This script get field "FamilWhoLogin" value of selected item. This field value have some user login value "domain\login". The script must get user profile property "Company" or "Department" value and set it to item field 'userOrg'. But I don't know, how to return value from getUserProperties(), set it to list 67799-run-on-selected-list-items.txtitem value, then update list item. This information about callback didn't help https://stackoverflow.com/questions/61124512/return-sharepoint-2013-current-user-using-javascript The script works fine, but it doesn't set field value from user profile property. I use SharePoint 2016. Would be grateful for any help. That the full script

Microsoft 365 and Office | SharePoint | For business | Windows

Answer accepted by question author

MichaelHan-MSFT 18,136 Reputation points
2021-02-16T02:35:03.52+00:00

Hi @Sevil Red ,

Here is my demo code for you, hope it helps you: https://github.com/hb1546297019/michael/blob/master/run-on-selected-list-items.js


If an Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.