Update setting for custom User Profile Property using JSOM or CSOM
-
11-10-2020 - |
Question
I have a custom User Profile Property
called Subscription
.
Now, there is a requirement where I need to update the setting Allow users to edit values for this property
using CSOM
or JSOM
. This would be updated on conditional basis.
Is there any reference code available to achieve this?
Solution
Unfortunately configuration of user profile properties in SharePoint cannot be performed using JSOM or CSOM. There's no remote APIs exposed for these capabilities, so they can only be modified using server side object model. This also means that only option to control those settings in SharePoint Online is by manually controlling them from the admin UIs.
There's following UserVoice entry to expose these kind of settings using remote APIs, but there's no commitment to provide this or any schedules - https://sharepoint.uservoice.com/forums/329220-sharepoint-dev-platform/suggestions/15146940-provide-the-ability-to-create-custom-user-profile. Not precisely the same business scenario, but exactly the same ask from API exposure perspective.
Vesa Juvonen, Microsoft