# Consumer Goods Rtr Datacloud Export Configure

Configure a Trade Promotion Management (TPM) org's RTR (Real Time Reporting) export...

- Repository: https://github.com/forcedotcom/sf-skills (1134 stars)
- Category: Engineering
- License: Apache-2.0
- Last updated: 2026-10-30
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add forcedotcom/sf-skills --skill consumer-goods-rtr-datacloud-export-configure -g -a claude-code -y`
Codex: `npx skills add forcedotcom/sf-skills --skill consumer-goods-rtr-datacloud-export-configure -g -a codex -y`
Cursor: `npx skills add forcedotcom/sf-skills --skill consumer-goods-rtr-datacloud-export-configure -g -a cursor -y`
Gemini CLI: `npx skills add forcedotcom/sf-skills --skill consumer-goods-rtr-datacloud-export-configure -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add forcedotcom/sf-skills`

## Description

Configure a Trade Promotion Management (TPM) org's RTR (Real Time Reporting) export pipeline to push promotion measures into Data Cloud (Data 360) for Trade Promotion Effectiveness (TPE) dashboards. Use when a customer or admin wants to set up the RTR export for Data Cloud measures, configure the RTR report for TPE, or as a delegated step from consumer-goods-tpe-dashboard-configure.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Setup RTR Data Cloud Export

Configures the Data-Cloud-targeted RTR exports: the `Data_Cloud_Enabled` system setting, a scoped SF Data Sync, an `RTR_Report_Configuration__c` record (with its `KPI_Set__c`) for Data Cloud export, and the export trigger/status/abort REST calls. Standalone and self-contained, runs on its own, or as a delegated step invoked by `consumer-goods-tpe-dashboard-configure`, which passes through its own already-collected username, dry-run flag, and GenieAdmin confirmation result.

**Distinct from a sibling CSV-export RTR skill** (if present in this org's checkout): that skill targets `Usage__c IN ('integrationmeta','reportmeta')` for CSV export to the CGCloud Processing Services host. This skill targets Data Cloud export. Same underlying `RTR_Report_Configuration__c` object and `KPI_Set__c` Apex patterns, different `Usage__c` values and `JSON__c` shape, this skill does not invoke or depend on that sibling.

**For now, this skill only supports `Usage__c = 'datacloudpromotionmeasuresmeta'`** (`JSON__c.object = "promotionmeasures"`), it is hardcoded, never asked as an input. `datacloudaccountplanmeasuresmeta` (account-plan measures) is not yet wired up.

## Inputs and namespace detection

Read `references/inputs-and-namespace.md` before starting. It covers:
- The username/dry-run/GenieAdmin/TPM-Admin/namespace inputs that must be collected (or passed through by a calling skill) before Phase 1.
- The Sales Org / KPI Set / measure-codes / date-from inputs that Phase 6 collects lazily, per Sales Org, only once its existing-config check comes back empty.
- The namespace-detection procedure (`scripts/detect-namespace.js`) and the four `NS`/`NS_SEGMENT`/`NS_APEX`/`NS_FIELD` derivations used throughout every phase below.
- `scripts/render-apex.js` (Apex template rendering) and `scripts/resolve-id-by-name.js` (name-to-id lookups) both load `scripts/soql-escape.js` to escape substituted/queried literals for safe SOQL/Apex interpolation.

## Phases

The rest: https://github.com/forcedotcom/sf-skills/blob/HEAD/plugins/builder/consumer-goods/skills/consumer-goods-rtr-datacloud-export-configure/SKILL.md
