updateDataConnector

Updates a CRM Analytics data connector.

Syntax 

1import { updateDataConnector } from 'lightning/analyticsWaveApi';
2updateDataConnector({ connectorIdOrApiName: string, dataConnector : DataConnectorInput }): Promise<DataConnector>

CRM Analytics API Resource 

1PATCH /wave/dataConnectors/${connectorIdOrApiName}

updateDataflowJob uses this CRM Analytics API resource.

Parameters 

Parameter NameTypeDescriptionRequired?
connectorIdOrApiNameStringThe ID or developer name of the data connector.Yes
dataConnectorObjectThe data connector instance to update. Use a Data Connector Input resource.Yes

Returns 

Usage 

There are several ways to use updateDataConnector. For example, you can display a list of data connectors and update the connection properties, label, or description.

This example adds an update button to a page with data connectors. The page must contain form elements for the information required to update the connector, like the label. Updating a data connector displays a toast message using the lightning/platformShowToastEvent module.

1import { LightningElement, api } from "lwc";
2import { updateDataConnector } from "lightning/analyticsWaveApi";
3import { ShowToastEvent } from "lightning/platformShowToastEvent";
4
5export default class UpdateDataConnector extends LightningElement {
6  @api dcId; // or fetch the ID of the data connector
7  dataConnector = {
8    label: "My SFDC Ext Connector",
9    description: "My updated connection to another SFDC org",
10  };
11
12  update(event) {
13    updateDataConnector({ connectorIdOrApiName: this.dcId, dataConnector: this.dataConnector })
14      .then(() => {
15        this.dispatchEvent(
16          new ShowToastEvent({
17            title: "Success",
18            message: "Data Connector updated",
19            variant: "success",
20          }),
21        );
22      })
23      .catch((error) => {
24        this.dispatchEvent(
25          new ShowToastEvent({
26            title: "Error updating data connector",
27            message: error.body.message,
28            variant: "error",
29          }),
30        );
31      });
32  }
33}

This button calls the updateDataConnector() method.

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