Scenario Overview
In this scenario the users needed the ability to execute a workflow on an Account record which would generate an email that would go out to the Primary Contact of the Account.
One of the key pieces is that within the body of the email we must dynamically inject a custom URL based on the 'Account Number' field on the Account record so we can track who has downloaded the brochure. Below is an example of what the email would look like with the dynamically constructed URL.
North52 Decision Suite Solution
The North52 Decision Suite solution works like this,
- A formula of type 'Process Genie' is created so it can execute as a step within a workflow
- When it reaches the 'Process Genie' step in the workflow it will execute the formula
- The formula looks at the description field of the email and replaces the string of text 'URL_PLACEHOLDER' with the actual URL
- When it generates the actual URL its uses the regarding field on the Email to lookup on the Account entity the 'Account Number' field
North52 Decision Suite Steps
The following set of steps outline how to create this Formula
- Create a new formula of type 'Process Genie'
- Set the Source Entity to 'Email'
- Copy & paste the formula below into the formula description
- Click save
Workflow Steps
The following set of steps outline how to create this Formula
- Create a new workflow named 'Generate Email' on the Account entity
- Set it to run only 'On Demand'
- Add a step to create an Email and set the details to be that as shown in the 'Configuration of Email Template' screenshot below
- Add a new step to the workflow to call the North52 Process Genie and configure it as shown in the 'Configuration of Process Genie' screenshot below
- You will need to use the shortcode on your formula rather than 'rr6' as shown in our example. Please see the top right hand corner of your formula for the shortcode
- You need to set the 'Primary Entity ID' parameter on the Process Genie step to be that of the 'Record URL Dynamic' of the Email Step.
- Add a new step to set the status of the email to pending send so that it will get sent
- Publish the workflow
- You are now ready to test
Configuration of Process Genie
Email Template Configuration
Formula
UpdateRecord('email',
[email.activityid] ,
SetAttribute('description',
Replace([email.description],
'URL_PLACEHOLDER',
'http://www.mycompany.com?brochureid=1234&accountid=' +
FindValue('account',
'accountid',
[email.regardingobjectid],
'accountnumber' ) ))
)
Wizard - FindValue
Please see below the wizard you can use to create the FindValue() function call used in this formula.
Note to find the value for Equals Value, you will need to go to the Source tab and search for "Regarding"