Setting up Flows for EN Contact Sync
With Salesforce ‘Workflows’ being deprecated, our instructions (below) that helps admins set ‘Workflows’ up is no longer valid.
Previous Workflow instructions
Flows vs. Workflows
Salesforce has replaced this with ‘Flows’. Below are the new instructions on how to set up a Flow.
Essentially, we want to replace what we have with the new instructions, but keeping them in line with the existing styling. There are more steps for Flows vs. Workflows, so we could break Rule 1 and Rule 2 into tabs potentially.
In order to successfully sync Engaging Networks supporters and Salesforce contacts, two Flow rules must be created in your Salesforce account.
Flow rules
To begin, in your Salesforce Instance, go to Setup > Process Automation > Flows and click New Flow in the top right.
Rule 1: "EN Push False"
This Flow updates a date field on the Contact, to help Engaging Networks know which Contacts have been updated since the last pull.
Once Flow builder has loaded, you will be asked what type of flow you want to create. Select “Record-Triggered Flow” and then click “Create”.
Once the “Configure Start” page has loaded:
Click below *Object and select Contact
In Configure Trigger – Trigger the Flow When: – Select – A record is created or updated
Under “Set Entry Conditions” change the condition requirements to “Formula evaluates to true”
Copy the formula from below, under “Rule 1 Formula” and paste it in to the formula box as shown in the image above. You can use the ‘Check Syntax’ button to confirm it is valid.
Make sure When to Run the Flow for Updated Records is set to – “Every time a record is updated and meets the condition requirements”.
Then change the Optimize the Flow for: “Fast Field Updates”.
Rule 1 Formula:
Copy the formula field, found in the Engaging Networks dashboard and paste it in to the formula box as shown in the image above.
You can use the ‘Check Syntax’ button to confirm it is valid.
Engaging Networks generates the conditional block dynamically, based on the fields on the Contact Mapping rule. You could add additional fields to the ruleset if you have additional business rules that fallout of what field should trigger a sync back to Engaging Networks.
Make sure When to Run the Flow for Updated Records is set to – “Every time a record is updated and meets the condition requirements”.
Then change the Optimize the Flow for: “Fast Field Updates”.
Rule 1 Formula:
Copy and paste the generated text from Engaging Networks (without quotations)
Click “Done” once all of these steps have been completed.
Once that has closed, you’ll see Flow Builder open in the background. Click the plus icon underneath “Start Condition” and select “Assignment” under the “Logic” header. (see above)
Now, you’ll see the “New Assignment” page.
Change the *Label to – “Update EN Modified”
Click under the “Variable” box in “Set Variable Values” and select “New Resource”
Change “Resource Type” to Formula and then change the “API Name” to “Now”.
For “Data Type” change this to “Date/Time”
Then inside the *Formula box type “now()” (no quotations).
Click Done.
You’ll be taken back to the “New Assignment” page.
Copy the following (without quotations) – “{!$Record.engaging__EN_Last_Modified_Date__c}” and paste this below the “Variable” box in “Search variables”.
Keep the “Operator” as Equals.
Click in the “Value” box and select your “Now” formula from the top.
Click “Done” once you have completed the above steps and this will take you back to Flow Builder.
Click “Save” at the top right. We recommend labelling this as “EN Push False”.
You will now be able to activate this Flow by clicking “Activate” at the top.
Rule 2: "EN Push True"
This rule will help prevent an “echo” in Engaging Networks pushing supporters to Salesforce.
Go to Setup > Process Automation > Flows
Click “New Flow” at the top right.
Again, we’ll be using the “Record-Triggered Flow”. Select this and click “Create”.
Change the:
*Object to “Contact”
*Trigger the Flow when “A record is created or updated”
Set Entry conditions: “Formula evaluates to true”
Copy the following (without quotations) and paste it into the formula box (below the grey boxes)
Rule 2 Formula
“engaging__EN_Push__c=True”
Change “When to Run the Flow for Updated Records” to “Every time a record is updated and meets the condition requirements” and “Optimize the Flow for:” to “Fast Field Updates”.
Click “Done”.
In Flow Builder, click the plus icon below the start condition and select Select ‘Add update triggering record’ under the Shortcuts header.
Change the label to “EN Push”
Make sure that “How to Find Records to Update and Set Their Values” is set to “Use the contact record that triggered the flow”
“Set Filter Conditions” to “None–Always update record”
Below “Field” in “Set Field Values for the Contact Record” copy and paste (without quotations) “engaging__EN_Push__c”.
Then click underneath “Value” in the same place and select the “$GlobalConstant.False” under “Global Constants”.
Click “Done”.
Finally, In Flow Builder, click “Save” at the top right.
We recommend labelling this “EN Push True”
To activate this flow, click “Activate” at the top right.