updatePartialWaveFolder

Performs a partial a specific CRM Analytics folder by ID.

Syntax 

1import { updatePartialWaveFolder } from 'lightning/analyticsWaveApi';
2updatePartialWaveFolder({ folderId: string, folder: BaseWaveFolderInput }): Promise<WaveFolder>

CRM Analytics API Resource 

1PATCH /wave/folders/${folderId}

updatePartialWaveFolder uses this CRM Analytics API resource.

Parameters 

Parameter NameTypeDescriptionRequired?
folderIdStringThe ID of the folder.Yes
folderObjectThe folder to update. Use a Base Wave Folder Input resource.Yes

Returns 

  • A Promise object that resolves with the Wave Folder response.

Usage 

Use updatePartialWaveFolder to allow users to update minimal folder details, like the label and icon. This example adds an update button to a page with folders. The page must contain form elements for the information required to update the folder. Updating a folder displays a toast message using the lightning/platformShowToastEvent module.

1import { LightningElement, api } from "lwc";
2import { updatePartialWaveFolder } from "lightning/analyticsWaveApi";
3import { ShowToastEvent } from "lightning/platformShowToastEvent";
4
5export default class UpdatePartialWaveFolder extends LightningElement {
6  @api fId; // or fetch the ID of the folder
7  folderObj = {
8    label: "Updated folder",
9  };
10
11  update(event) {
12    updateWaveFolder({ id: this.fId, folder: this.folderObj })
13      .then(() => {
14        this.dispatchEvent(
15          new ShowToastEvent({
16            title: "Success",
17            message: "Folder updated",
18            variant: "success",
19          }),
20        );
21      })
22      .catch((error) => {
23        this.dispatchEvent(
24          new ShowToastEvent({
25            title: "Error updating folder",
26            message: error.body.message,
27            variant: "error",
28          }),
29        );
30      });
31  }
32}

This button calls the updatePartialWaveFolder() method.

1<template>
2  <lightning-button
3    label="Update Folder"
4    icon-name="utility:play"
5    icon-position="right"
6    onclick={update}
7  ></lightning-button>
8</template>