Update Contact Address When Source = Cvent

Today we are going to create a process that updates the Contact Mailing Address when getting an event registration from Cvent (Event Management Software).

Salesforce Process Automation Tool: Process Builder.

Two things to have in consideration:
1. Street 2 is being captured in a Custom Contact field.
2. Mailing Address (Data Type = address) is a Compound Field.

What is a Compound Field?

Compound fields group together multiple elements of primitive data types, such as numbers or strings, to represent complex data types, such as a location or an address. Compound fields are an abstraction that can simplify application code that handles the values, leading to more concise, understandable code.

Mailing Address is a compound of the following fields: Mailing City, Mailing Country, Mailing Geocode Accuracy, Mailing Latitude, Mailing Longitude, Mailing State/Province, Mailing Street, Mailing Zip/Postal Code.

Steps

  1. Create a Contact Custom Field called “Mailing Street 2”.
  2. Map Cvent “Street 2” Contact field to Salesforce “Mailing Street 2” Contact field.
  3. Create a Process in Process Builder.
    OBJECT
  4. Choose Object: Contact
    NODE
  5. Specify When to Start the Process: when a record is created or edited
  6. Define Criteria for this Action Group: Name your Criteria.
  7. We are going to define two conditions:
    a) Is “Mailing Street 2” different than NULL?
    b) Does “Mailing Street” contain “”Mailing Street 2”?
  8. Customize the logic: 1 AND NOT 2. Please note the “NOT 2″. We are going to update “Mailing Street” only if it is not already part of “Mailing Street”. We need to check on this to avoid concatenating “Mailing Street 2” to “Mailing Street” indefinitely when editing the address/record.
    IMMEDIATE ACTIONS
  9. Name your action.
  10. Record: Contact
  11. Criteria for Updating Records: No criteria—just update the records!
  12. Set new field values for the records you update
  13. Update Mailing Street by using the following formula:
    [Contact].MailingStreet &
    SUBSTITUTE($Label.New_Line, “-“,””)&
    [Contact].MailingStreet_2__c
  14. If you are wondering about this line of code: “SUBSTITUTE($Label.New_Line, “-“,””)&”, please refer to this blog. It explains how to add a line break between “Mailing Street” and “Mailing Street 2”. There’s a known issue with the BR() function, so don’t even try it. It would be a waste of time. I know! It’s a pain.

That’s it! I hope this was helpful to you. Let me know if you have any comments.

BONUS
If you get ever get this error: “The filter logic references an undefined filter”.
It means that you need to reference to all of your conditions when customizing the logic.

PD: I dedicate this blog post to my 7 year old daughter who is always reminding me and encouraging me to update my blog. ❤️