AppFlow Salesforce: how to sync up relationships

An elegant solution to sync up relationships from Salesforce to AppFlow


Andres Canavesi
Nov 10, 2021
featured image

One object at a time

At the time of writing this post, it's not possible to sync up relationships from Salesforce to AppFlow. Only basic types such as strings or numbers can be passed through AppFlow which means that look-up fields will be ignored. There's a way you can do it with some work from using the Salesforce out-of-the-box Process Builder tool, a custom object and some lines of Apex code.

The trick

We will need these three things to send out our related fields through AppFlow
  • A custom object
  • An Apex class
  • Process Builder

The custom object

This custom object will hold all three attributes to be synchronized. It will be our DTO(Data Transfer Object)

The Apex class

It will gather all the information we need and instantiate our DTO. Once inserted, Change Data Capture will take over the control to send our data to AppFlow

The flow built using Process Builder

It will call our Apex class under the conditions we want. It can be a "just execute every time I save an Account " or with more complex rules
appflow salesforce apex aws dev