Example 2: Create a Case on Low NPS
  • 13 Nov 2024
  • 2 Minutes to read
  • Dark
    Light

Example 2: Create a Case on Low NPS

  • Dark
    Light

Article summary

NOTE

This example should be used as a reference to understand basic concepts and ideas on integrating with Relay Network. It should not be taken literally as this is how integration to Relay must be done. You should replace your record types, field names, business logic, etc. with those that match your business process and setup.


Example Goals

In this example, we will monitor user responses (from the Relay Feed) related to our Company’s NPS. User responses, from the Feed, arrive as events and are stored in the RelayEvents__c custom object. If the user responds with a poor rating, we will create a new Salesforce case for a follow up with the user.

Assumptions

  • The Relay Connected App was configured to allow Relay to push RelayEvent__c record to your Salesforce org.

  • A Relay message was sent to a specific Person Account’s Relay Feed.

    • The Person Account has a custom field, RelayCCID__c, that hold the unique CCID value for the user.

  • The Relay message allows the user to click on a Feed action to rate the Company.

Security and Permissions

Record triggered flows always run as the System Context without Sharing. This provides access to all objects and their fields.

Flow Resources

Resource Name

Type

Description

NewCase

Resource Type → Variable

Data Type → Record

Object → Case

If the trigger conditions are met, this resources will be populated with details and submitted to the Create Records action.

Flow

rn-sfdc-flows-example2-flow_diagram

(1) Configure the Start Element

The majority of the flow logic all happens in the Start Element.

  • Create a Record-Triggered Flow on the RelayEvents__c record type

  • Set the Configure Trigger to A Record is Created

  • Set the following Entry Conditions:

    • Condition Requirements All Conditions Are Met (AND)

      • FieldTriggerID__cEqualsProvide a valid Relay Trigger ID value corresponding to the correct Relay Message.

  • Check that the EventType__c field refers to an experience action.

  • Check that the ActionLabel__c field refers to Poorly, which indicates the user is unhappy with us.

  • It is generally a good idea to put the this type of flow logic in a Run Asynchronously Path ensuring the RelayEvent__c record is always created.

rn-sfdc-flows-example2-trigger-conditions

(2) Add a Get Records Element

Locate the Person Account record using the CCID from the triggered event record.

rn-sfdc-flows-ex2-get_record

(3) Verify Person Account was Found

Add a Decision element to verify the record was located.

rn-sfdc-flows-ex2-decision

(4) Create a new Case Record

If we found the matching record, we will create a new Case and assign to the located record.

  • Add an Assignment element to the flow

  • Populate the NewCase resource with the appropriate field values.

rn-sfdc-flows-ex2-assign_case

(5) Create the new Case Record

  • Add a Create Records element to the flow

  • Specify the NewCase resource as the record to be created.

rn-sfdc-flows-ex2-create_case


Was this article helpful?

ESC

Eddy AI, facilitating knowledge discovery through conversational intelligence