Skip to main content
TDX, the developer conference for the AI agent era is happening now. Watch live on Salesforce+ for exclusive digital content, a revolutionary keynote, and more.

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. Add the following details under Second Node.
    • Source Node: Filter Active Loyalty Program Members
    • Select the following fields:
      • AccountId
      • Id
      • MembershipNumber
      • MemberStatus
      • ProgramId
  6. Add the following details under Mapped Fields.
    • First Node Field: Order_AccountId
    • Second Node Field: AccountId
  7. Click Save, and then save all your work.
    The join node to join the active orders with program members.

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. When finished, be sure to save your work.

Name

API Name (auto-populated)

Type

JournalSubtypeId JournalSubtypeId

Text

PartnerId PartnerId

Text

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. Be sure to save your work when finished.

    Alias

    Field Type

    Length

    Search fields

    JournalSubtypeId

    Text

    40

    {$JournalSubtypeId}

    JournalTypeId

    Text

    40

    {$JournalTypeId}

    PartnerId

    Text

    40

    {$PartnerId}

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. When finished, be sure to save your work.

    Source Node Field

    Target Field

    ActivatedDate

    Activity Date

    JournalTypeId

    JournalTypeId

    JournalSubtypeId

    JournalSubTypeId

    TotalAmount

    TransactionAmount

    ActivatedDate_c

    InvoiceDate

    Id

    MemberId

    ProgramId

    LoyaltyProgramId

    PartnerId

    PartnerId

Here’s the completed configuration.

The writeback object node for creating transaction journals.

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. Be sure to save your work.

    Source Node Field

    Target Field

    Order_Id

    Id

    CopyOrderStatus

    OrderStatusCopy__c

Here’s the completed configuration.

The writeback object node for updating the order status.

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.

Verify Step

+100 points

You’ll be completing this project in your own hands-on org. Click Launch to get started, or click the name of your org to choose a different one.

Share your Trailhead feedback over on Salesforce Help.

We'd love to hear about your experience with Trailhead - you can now access the new feedback form anytime from the Salesforce Help site.

Learn More Continue to Share Feedback