Invocable – Auto Consent Creation – Cloud Compliance

Cloud Compliance – GDPR Data Management’  has one feature called Consent management which basically automates the full lifecycle of Consent including Self-service for Leads, Contacts, and Individuals in Salesforce.

The solution given in this document create consents for specific purpose against particular channel. This note explains how to invoke Auto Consent Creation with the help of Process Builder.

Solution Steps

1. Create Few Checkboxes in the Contact Object. For example:

  • Marketing – Phone
  • Survey- Phone
  • Sales -Phone
  • Customer Support – Phone

2. Add those checkboxes in the Contact page layout under a separate section which will be called Consents.

3. Navigate to Data Use Purpose and create a few Channels and Purposes.

4. Create a formula field on a Contact object called Consents.

Format of the formula should be as follows:-

IF(Data use purpose API name = true, “Data Use Purpose id -1, “,” Data use purpose id-0,”)&

IF(Data use purpose API name = true, “Data Use Purpose id -1 “,” Data use purpose id-0”)

Here is an example of the formula field created for different Data use purposes.
keting_Phone__c =true, “0ZW2v000000blPDGAY-1,”,”0ZW2v000000blPDGAY-0,”)&

<!-- wp:heading {"level":3} -->
h3 > If(Customer_Phone__c = true, "0ZW2v000000blP3GAI-1,", "0ZW2v000000blP3GAI-0,") & amp; < /h3> <
!--/wp:heading -->

!--wp: heading {
        "level": 3
    } -->
    h3 > If(Sales_Phone__c = true, "0ZW2v000000blP9GAI-1,", "0ZW2v000000blP9GAI-0,") & amp; < /h3> <
!--/wp:heading -->

!--wp: heading {
        "level": 3
    }-- >
    h3 > If(Survey_Phone__c = true, "0ZW2v000000blP8GAI-1", "0ZW2v000000blP8GAI-0") < /h3> <
    !--/wp:heading -->

5. Copy the respective ids from the Data use purpose and paste it in the above formula

6. Create the Process Builder on Contact Object which will fire whenever there is a selection/deselection on the Consent checkboxes.

This Process builder will auto-create consents whenever a new contact record is created or whenever consents checkboxes are selected/deselected. The Formula on this node is as follows:-

OR(ISNEW(), ISCHANGED([Contact].Consents__c))

The immediate action will call the invocable APEX class “Process builder-Create Consents for SObject” and the input parameters to that invocable will be as follows:-

sendConfirmationemail                   BooleanTrue
idsField reference           [Contact].Id    
commaSepPurposeIdStringField reference[Contact].Consents__c      

Click on Save and Activate the Process Builder.

To Validate the Auto consent creation

Navigate to the Contact Record. Select any 2 checkboxes of Consents on details Page.

For example – Survey-Phone and Sales-Phone.

Go to the Consents Tab on the Contact page


This enhancement enables Auto consent creation while creating a Contact/Lead.