getReplicatedFieldsWithAdvancedProps

Retrieves a collection of fields, using advanced filtering options, belonging to a CRM Analytics replicated dataset, also known as a connected object.

Syntax 

1import { getReplicatedFieldsWithAdvancedProps } from 'lightning/analyticsWaveApi';
2getReplicatedFieldsWithAdvancedProps( {id: string, advancedProps: SourceObjectDataInput} ): Promise<ReplicatedFieldCollection>

CRM Analytics API Resource 

1POST /wave/replicateddatasets/${id}/fields

getReplicatedFieldsWithAdvancedProps uses this CRM Analytics API resource.

Parameters 

Parameter NameTypeDescriptionRequired?
idStringThe ID of the replicated dataset.Yes
sourceObjectParamObjectThe SourceObjectDataInput providing the advanced properties for filteringYes

Returns 

Usage 

There are several ways to use getReplicatedFieldsWithAdvancedProps. For example, you can display a list of replicated datasets and the filtered fields for each replicated dataset.

This example adds a Get button to a page with replicated datasets. The page must contain form elements for the information required to filter the fields for the replicated dataset, like the advanced properties names and values, and a list of fields to filter. Filtering the fields for a replicated dataset displays a toast message using the lightning/platformShowToastEvent module.

1import { LightningElement, api } from 'lwc';
2import { getReplicatedFieldsWithAdvancedProps } from 'lightning/analyticsWaveApi';
3import { ShowToastEvent } from 'lightning/platformShowToastEvent';
4
5export default class GetReplicatedFieldsWithAdvancedProps extends LightningElement {
6  @api rdId; // or fetch the ID of the replicated dataset
7  sourceObjectData = {
8    "advancedProperties" : [
9      {"name": "filterProp1", value: "filterValue1"},
10      {"name": "filterProp2", value: "filterValue2"}
11    ]
12    "sourceObjectFields" : [ "Field1", "Field2", "Field3" ]
13  };
14
15  get(event) {
16    getReplicatedFieldsWithAdvancedProps({ id: this.rdId, sourceObjectData : this.sourceObjectData })
17      .then(() => {
18        this.dispatchEvent(
19          new ShowToastEvent({
20            title: 'Success',
21            message: 'Replicated dataset fields filtered',
22            variant: 'success'
23          })
24        );
25      })
26      .catch(error => {
27        this.dispatchEvent(
28          new ShowToastEvent({
29            title: 'Error filtering replicated dataset fields',
30            message: error.body.message,
31            variant: 'error'
32          })
33        );
34      });
35  }
36}

This button calls the getReplicatedFieldsWithAdvancedProps() method.

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

Release Preview

This release is in preview. Features described here don't become generally available until the latest general availability date that Salesforce announces for this release. Before then, and where features are noted as beta, pilot, or developer preview, we can't guarantee general availability within any particular time frame or at all. Make your purchase decisions only on the basis of generally available products and features.