aequos-solutions / modern-data-visualizer

Documentation for the Modern Data Visualizer solution
https://aequos-solutions.github.io/modern-data-visualizer/
7 stars 7 forks source link

Update profile service from a call #93

Closed rachelmarshall closed 1 year ago

rachelmarshall commented 1 year ago

Version used 1.4.0

Question !We would like to have an icon to mark an item to update profile services if selected.

An example we would like to add a toggle to search results to mark an item as an action completed.

example code
Please check PDSB Github for more details concerning the code part

Updating Profile services -> Post Request
const responseUrl = `${context.pageContext.web.absoluteUrl}/_api/SP.UserProfiles.PeopleManager/SetMultiValuedProfileProperty` ;

let userData = {
   'accountName': "i:0#.f|membership|" + context.pageContext.user.email,
   'propertyName': profilePropName,
   'propertyValues': updatedIds
 },
 spOptions: ISPHttpClientOptions = {
   headers:{
    "Accept": "application/json;odata=nometadata", 
    "Content-Type": "application/json;odata=nometadata",
    "odata-version": "",
 },
 body: JSON.stringify(userData)
 };

const _data = await context.spHttpClient.post(responseUrl, SPHttpClient.configurations.v1, spOptions);

completed context about the problem here.

Laul0 commented 1 year ago

Hi @rachelmarshall,

In your case, you need custom Layouts. Thanks to the custom Layouts you can:

You will find all information about the Extensibility in our documentation.

We hope this information will help you 🙂