Available in: DESelect Plus, DESelect Advanced.
Using fields in dynamic custom values
This month, we’re making it possible to refer to fields in dynamic custom values, the DESelect alternative to CASE WHEN statements in SQL. Please have a look at 2 common use cases below.
Example 1: Taking Phone or Mobile Phone
We have a list of contacts, and for each contact, we have a mobile phone number, a landline phone number, or both. For each contact, we need to take one phone number. In case we do have a mobile phone number, we want to take that one. If we don’t have a mobile phone number but we have a landline phone number, we want to take the landline. If we don’t have any phone number, we want to choose a NULL value.
In DESelect we can easily do this via the creation of a dynamic custom value.
In the Target Definition Screen, click on Add new value under Custom Values and give it a name to create a custom value of type Dynamic Value.
For Field Type, we choose Phone. Now we’ll add 2 criteria by clicking the Add Criteria button.
Under the When statement for the first criteria, we build a filter using the Mobile Phone Number field, and choose filter type Is not empty.
Under the Then statement, we click on the grid icon to switch to using fields, and then refer to the Mobile Phone Number field.
Now let’s add the second criteria.
Under the When statement, we build a filter using the Landline Phone Number field, and choose filter type Is not empty.
Under the Then statement, we click on the grid icon to switch to using fields, and then refer to the Landline Phone Number field.
Now when we map this custom value to a target data extension, we’ll get the mobile or landline phone number in the Phone field depending on what’s available.
Example 2: Taking Lead Name or Contact Name of Campaign Member
When pushing CampaignMember data from Salesforce Sales Cloud to Salesforce Marketing Cloud, you’ll notice a CampaignMember can be linked to either a Lead or a Contact.
First, we need to make sure that the Salesforce_Lead and Salesforce_Contact data extensions are linked to Salesforce_CampaignMember in the Selected Data Extensions section.
You can now use a dynamic custom value to take the First Name from either the Contact or the Lead.
We can do something very similar to what we did in the example above with the phone number: if the ContactId on CampaignMember is filled out, we take the First Name from the Contact record.
If the LeadId on CampaignMember is filled out, we take the First Name from the Lead record.
When mapping this custom value with our target data extension, we’ll get the First Name of the Campaign Member, no matter if that Campaign Member was a Lead or a Contact.
Conclusion
Dynamic custom values are an easy way to allow marketers to choose which field to use, depending on the value that’s filled out or relevant.
To try out this feature for yourself, request a demo now.