Overview
In this scenario, we want to send a follow up email using a workflow setting the To field using an address we get from the email's related Account.
Out of the box this is not possible, however, we can do this using North52's native functions.
Note: We could in theory remove the workflow and do everything in the formula. However in the real world, its more likely that this requirement will be part of a process that uses workflows.
North52 Decision Suite
The North52 Decision Suite solution works like this:
- A Formula is set up on the Email entity
- It will update the To field with the value from the related Account email address 3 field
- A Workflow is created that has two steps:
- Create the email
- Use North52s Process Genie to call the formula
Set up Workflow and Formula
Formula
- Create a new formula, setting the following values in the Formula Guide:
- Source Entity set to Email
- Set Formula Type to Process Genie
- Select the Classic editor
- Change the Name of the formula to Set To field to the Accounts Email Address 3
- Copy and paste the following formula into the main editors canvas:
Smartflow(
SetVar('ActivityPartyEC', CreateEC()),
AddEntityToEC(GetVar('ActivityPartyEC'), CreateEntity('activityparty', SetAttribute('addressused', [email.regardingobjectid.emailaddress3.?]))),SetVar('EmailNative',CreateEntity('email', SetAttribute('activityid', [email.activityid])) ),
UpdateEntityNative(GetVar('EmailNative'),
SetAttributeNative('to', GetVar('ActivityPartyEC'))),
UpdateRecordFromEntity(GetVar('EmailNative')),SendEmail([email.activityid])
) - Click Save
- Take note of the Formula Short Code in the top right hand corner of the form
Workflow
- Navigate to Settings > Processes
- Click the New icon
- Enter Create Email and set the To field as the process name
- Select Workflow for the Category
- Select Account for the Entity
- Select OK
- Check As an on-demand process
- Uncheck Record is created
- Select Add Step > Create Record
- Select Add Step > North52 > N52 Process Genie
- Select View Properties
Testing
To test this scenario, open an Account. Make sure it has an email address in the email address 3 field and run the workflow. You can see the workflow running Settings > System Jobs