Skip to main content
Build the future with Agentforce at TDX in San Francisco or on Salesforce+ on March 5–6. Register now.

Add Nodes to Complete the Data Processing Engine Definition

Join Active Orders with Loyalty Program Members

From the orders and contacts, you get the account ID of the customer. Based on this common criteria, join the records of the orders and the members.

  1. Click New Node and add the following details.
    • Node Type: Join
    • Name: Join Active Orders with Loyalty Program Members
    • API Name: Auto-populates with Join_Active_Orders_with_Loyalty_Program_Members
  2. Click Save.
  3. Select Join Type as Inner.
  4. Add the following details under First Node.
    • Source Node: Filter Active Orders
    • Select Fields: Select all
  5. Click Save.
  6. Add the following details under Second Node.
    • Source Node: Filter Active Loyalty Program Members
    • Select the following fields:
      • AccountId
      • Id
      • MembershipNumber
      • MemberStatus
      • ProgramId
  7. Click Save.
  8. Add the following details under Mapped Fields.
    • First Node Field: Order_AccountId
    • Second Node Field: AccountId
  9. Click Save.
    The join node to join the active orders with program members.
  10. Save your work.

You now have all the necessary information about members and their orders. But for DPE to start doing its magic, you must bring in more information to trigger loyalty processes.

Add Journal Details and Order Status

To trigger relevant loyalty processes, the loyalty system uses data from the transaction journal. The information you need depends on the process.

The Cloud Kicks Inner Circle program rewards members for accruals related to partner purchases. So you need the journal type, journal subtype, and partner details. Use a formula node to fetch this information. The node stores these values in input variables and passes on the information to writeback nodes.

Additionally, use the formula node to mark the Order Status Copy field as Processed so that these orders aren't used to accrue loyalty rewards more than once.

First, create the three input variables.

  1. Click Open the Nodes and Input Variables panel .
  2. Click the Input Variables tab.
  3. Click New Input Variable.
  4. Add the following details.
    • Name: JournalTypeId
    • API Name: Auto-populates with JournalTypeId
    • Type: Text
  5. Click Save.
  6. Repeat steps 3 to 5 with the following details.

    Name

    API Name (auto-populated)

    Type

    JournalSubtypeId JournalSubtypeId

    Text

    PartnerId PartnerId

    Text

  1. Save your work.

Next, create a formula node to update the order status copy, and insert the values for the three variables.

  1. Click New Node and add the following details.
    • Node Type: Formula
    • Name: Add Journal Details and Order Status
    • API Name: Auto-populates with Add_Journal_Details_and_Order_Status
  2. Click Save.
  3. Click the Add Journal Details and Order Status node and select Configure.
  4. Select Source Node as Join Active Orders with Loyalty Program Members.
  5. Add the following details under Formulas.
    • Alias: CopyOrderStatus
    • Field Type: Text
    • Length: 40
    • Enter formula in the text box: "Processed"
  6. Click Validate Syntax.
  7. Click Add Formula.
  8. Repeat steps 5 to 7 with the following details:

    Alias

    Field Type

    Length

    Search fields

    JournalSubtypeId

    Text

    40

    {$JournalSubtypeId}

    JournalTypeId

    Text

    40

    {$JournalTypeId}

    PartnerId

    Text

    40

    {$PartnerId}

  9. Click Save.
    The formula node where you define the formulas to add journal details and order status.
  1. Save your work.

DPE has transformed the data, so now it’s time to move it into target objects. You need two writeback object nodes to create transaction journals and update the order status.

Create Transaction Journal

The first writeback object node inserts a new record with the transformed data. In other words, the DPE creates a new record in the Transaction Journal object with the transformed data.

  1. Click New Node and add the following details.
    • Node Type: Writeback Object
    • Name: Create Transaction Journal
    • API Name: Auto-populates with Create_Transaction_Journal
  2. Click Save and add the following details.
    • Source Node: Add Journal Details and Order Status
    • Target Type: Salesforce Object
    • Action Type: Insert
    • Target Object: Transaction Journal
    • User with Writeback Permission: Select your name
    • Writeback Sequence: 1
  3. Add the following details under Field Mapping. Click Add Row after mapping each field.

    Source Node Field

    Target Field

    ActivatedDate

    Activity Date

    JournalTypeId

    JournalTypeId

    JournalSubtypeId

    JournalSubTypeId

    TotalAmount

    TransactionAmount

    ActivatedDate_c

    InvoiceDate

    Id

    MemberId

    ProgramId

    LoyaltyProgramId

    PartnerId

    PartnerId

  1. Click Save.
    The writeback object node for creating transaction journals.
  2. Save your work.

Update Order Status

The second writeback object node updates the order status copy field. The formula field only holds the value of the field. This node performs the action of updating the field from Pending to Processed.

  1. Click New Node and add the following details.
    • Node Type: Writeback Object
    • Name: Update Order Status
    • API Name: Auto-populates with Update_Order_Status
  2. Click Save and add the following details.
    • Source Node: Add Journal Details and Order Status
    • Target Type: Salesforce Object
    • Action Type: Update
    • Target Object: Order
    • User with Writeback Permission: Select your name
    • Writeback Sequence: 2
  3. Add the following details under Field Mapping. Click Add Row after mapping each field.

    Source Node Field

    Target Field

    Order_Id

    Id

    CopyOrderStatus

    OrderStatusCopy__c

  1. Click Save.
    The writeback object node for updating the order status.
  1. Save your work.

You’ve added all the required nodes, so here’s your chance to activate the definition.

Activate the DPE Definition

In the Create Transaction Journals From Orders DPE definition, click Activate.

The DPE builder page where you activate the definition.

You created all the necessary nodes to transform data from orders to actionable data for creating transaction journals. In the next step, you learn how to run and monitor a DPE definition.

Salesforce ヘルプで Trailhead のフィードバックを共有してください。

Trailhead についての感想をお聞かせください。[Salesforce ヘルプ] サイトから新しいフィードバックフォームにいつでもアクセスできるようになりました。

詳細はこちら フィードバックの共有に進む