---
schema_version: "1"
id: 3dd3e4b53072dcefc3d9fc60ae8b8764e6890f73ceb5346beac021b14210b5e5
title: Promotion Wizard Input Structure
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/retail_api/NewPromotionWizardInputStructure.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.retail_api.meta/retail_api/NewPromotionWizardInputStructure.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 7f38465e7ec74bcbbc647ca0c97780ab276b21d4197aa9333f4efb52a243460b
description: This document describes the input that SmartUI generates when initializing the new metadata-driven promotion wizard. SmartUI extracts information on where the user clicked when launching the wizard in order to provide as much information as possible to the wizard so it can be used to provide sensible defaults.
---
# Promotion Wizard Input Structure

This document describes the input that SmartUI generates when initializing the new metadata-driven promotion wizard. SmartUI extracts information on where the user clicked when launching the wizard in order to provide as much information as possible to the wizard so it can be used to provide sensible defaults.

## Input Sample for New Promotion

{
    "Slogan": "Sample Slogan",
    "GroupText": "Sample Group Text",
    "initialDate": 1603670400000,
    "AnchorAccount": "0012X000023GAClQAO",
    "criterion\_1\_product\_\_c": "a2L2X00000Bw3LeUAJ",
    "criterion\_3\_product\_\_c": "a2L2X00000Bw3MxUAJ",
    "pack\_size\_unit\_\_c": "pk",
    "PromotionTemplate": "a2a2X000003NMgFQAW",
    "product\_form\_\_c": "Solid"
}

## Properties

This method returns a list of items with the following properties:

<table class="featureTable sort_table" summary="">



            <thead class="thead sorted" align="left">
              <tr>
                <th class="featureTableHeader  " id="d122412e62">Property Name</th>

                <th class="featureTableHeader  " id="d122412e65">Type</th>

                <th class="featureTableHeader  " id="d122412e68">Description</th>

              </tr>

            </thead>

            <tbody class="tbody">
              <tr>
                <td class="entry" headers="d122412e62" data-title="Property Name">Slogan</td>

                <td class="entry" headers="d122412e65" data-title="Type">String</td>

                <td class="entry" headers="d122412e68" data-title="Description">
                  <p class="p">Promotion slogan of the row where the user clicked to create a new
                    promotion.</p>

                </td>

              </tr>

              <tr>
                <td class="entry" headers="d122412e62" data-title="Property Name">GroupText</td>

                <td class="entry" headers="d122412e65" data-title="Type">String</td>

                <td class="entry" headers="d122412e68" data-title="Description">
                  <p class="p">Group text of the row where the user clicked to create a new promotion.</p>

                </td>

              </tr>

              <tr>
                <td class="entry" headers="d122412e62" data-title="Property Name">initialDate</td>

                <td class="entry" headers="d122412e65" data-title="Type">Number</td>

                <td class="entry" headers="d122412e68" data-title="Description">Timestamp of the date on the calendar view the user clicked on in
                  milliseconds.</td>

              </tr>

              <tr>
                <td class="entry" headers="d122412e62" data-title="Property Name">AnchorAccount</td>

                <td class="entry" headers="d122412e65" data-title="Type">Id</td>

                <td class="entry" headers="d122412e68" data-title="Description">
                  <p class="p">Account of the row where the user clicked to create a new promotion.</p>

                </td>

              </tr>

              <tr>
                <td class="entry" headers="d122412e62" data-title="Property Name">PromotionTemplate</td>

                <td class="entry" headers="d122412e65" data-title="Type">Id</td>

                <td class="entry" headers="d122412e68" data-title="Description">
                  <p class="p">Promotion template of the row where the user clicked to create a promotion.</p>

                </td>

              </tr>

              <tr>
                <td class="entry" headers="d122412e62" data-title="Property Name">criterion_&lt;X&gt;_product__c</td>

                <td class="entry" headers="d122412e65" data-title="Type">Id</td>

                <td class="entry" headers="d122412e68" data-title="Description">
                  <p class="p">Product hierarchy of the row where the user clicked to create a promotion.</p>

                </td>

              </tr>

              <tr>
                <td class="entry" headers="d122412e62" data-title="Property Name">&lt;x&gt;__c</td>

                <td class="entry" headers="d122412e65" data-title="Type">String</td>

                <td class="entry" headers="d122412e68" data-title="Description">
                  <p class="p">Additional product grouping attributes present in the row where the user
                    clicked to create a promotion.</p>

                </td>

              </tr>

            </tbody>

          </table>

## Input Sample for Copy Promotion

{
    "promotionId": "a2a2X000003NMgFQAW"
}

## Properties

This method returns a list of items with the following properties:

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d122412e213">Property Name</th>

              <th class="featureTableHeader  " id="d122412e216">Type</th>

              <th class="featureTableHeader  " id="d122412e219">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d122412e213" data-title="Property Name">promotionId</td>

              <td class="entry" headers="d122412e216" data-title="Type">String</td>

              <td class="entry" headers="d122412e219" data-title="Description">
                <p class="p">ID of the promotion that is copied.</p>

              </td>

            </tr>

          </tbody>

        </table>

## Input Sample for Derive Promotion

{
    "promotionId": "a2a2X000003NMgFQAW"
}

## Properties

This method returns a list of items with the following properties:

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d122412e277">Property Name</th>

              <th class="featureTableHeader  " id="d122412e280">Type</th>

              <th class="featureTableHeader  " id="d122412e283">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d122412e277" data-title="Property Name">promotionId</td>

              <td class="entry" headers="d122412e280" data-title="Type">String</td>

              <td class="entry" headers="d122412e283" data-title="Description">
                <p class="p">ID of the promotion that is derived..</p>

              </td>

            </tr>

          </tbody>

        </table>

## Using MetadataWizard in custom components

MetadataWizard engine can be used in Aura components to render wizards in your custom Aura components.

**Component Markup**

<aura:component implements="..." >
    <aura:handler name="init"
        value="{!this}"
        action="{!c.doInit}"
    />
    <!-- Add wizard to markup -->
    <cgcloud:MetadataWizard aura:id="wizard"></cgcloud:MetadataWizard>
</aura:component>

**Component Controller**

({
    doInit : function(component, event, helper) {
        // initialize the wizard
        component.find('wizard').runWizard({
                metadataName: 'NewPromotion',   // MetadataWizard metadata name to load the configuration from
                modal: false,                   // If the content will be rendered in a modal window or in place.
                input: {                        // Initial input state
                    TestCheckbox: true
                }
            })
                .then($A.getCallback((result) => {
                    // Show spinner
                    component.find('wizard').showSpinner(); // Display a spinner
                    // process the result
                    console.log('Result Action: ', result.action);      // Action that triggered the the resolution
                    console.log('Result: ', result.result);             // Wizard result, this can be passed to an API
                    console.log('Result: ', result.stateBeforeSubmit);  // Wizard state before submission
                    // hide spinner
                    component.find('wizard').hideSpinner(); // Hide the spinner
                }));
        });
    }
})

<table class="featureTable sort_table" summary=""><tbody class="tbody"><tr><td class="entry">Parameter</td><td class="entry">Type</td><td class="entry">Required</td><td class="entry">Default Value</td><td class="entry">Description</td></tr><tr><td class="entry">metadata</td><td class="entry">Object</td><td class="entry">true*</td><td class="entry"></td><td class="entry">Object representing the Wizard metadata (same format as on MetadataWizard Configuration Record).</td></tr><tr><td class="entry">metadataName</td><td class="entry">String</td><td class="entry">true*</td><td class="entry"></td><td class="entry">MetadataWizard configuration record name to extract the metadata from.</td></tr><tr><td class="entry">input</td><td class="entry">Object</td><td class="entry">FALSE</td><td class="entry">{}</td><td class="entry">Metadata Wizard Input. This object can be accessed in expressions using the <samp class="codeph nolang">_input_</samp> identifier.</td></tr><tr><td class="entry">stateBeforeSubmit</td><td class="entry">Boolean</td><td class="entry">FALSE</td><td class="entry">FALSE</td><td class="entry">Represents the state of the wizard input state between executions of the <samp class="codeph nolang">runWizard</samp> function.</td></tr><tr><td class="entry">modal</td><td class="entry">Boolean</td><td class="entry">FALSE</td><td class="entry">FALSE</td><td class="entry">If true, the wizard will e rendered as a modal. If false, the wizard will be rendered inline.</td></tr></tbody></table>