Transformations: Enable opt-in for actual values for Salesforce Data instead of fivetran_formula_model
AnsweredHello there!
I would like to request the option to include Salesforce data as actual values rather than as formula fields, by choice.
Currently, Fivetran does not allow the export of formula fields.

The only option currently available to us through dbt is to use the Fivetran formula fields macro. While it is a viable option, it introduces some additional challenges:
- Some formulas cannot be translated into SQL, resulting in "NULL" appearing in the formula_view
- Some formulas include conditions for values in other objects, and these also seem not to be translatable into SQL
- The query string embedded in MODEL automatically filters out fivetran-deleted values, and there are scenarios where we need to retain them
- The query string located in the column (MODEL) that dbt reads is not fixed; it sometimes changes and excludes columns that should be included. This inconsistency leads to errors downstream from time to time (see picture below)

Based on the problems mentioned above, we have following options to solve them:
- Write our own macro to replace the one currently used by the dbt package
- Build a custom pipeline that imports the actual values for calculated fields
- Allow for the hard-copying of values at our own risk
Writing Our Own Macro is problematic due to the need for ongoing maintenance and the inability to influence the model's query string, which leads to losing fivetran_deleted values.
Building a Custom Pipeline requires significant effort and maintenance, making it inconvenient as it forces the use of two systems for one data source import
Therefore, the preferred solution is:
Importing Hard-Copied Values from Formula Fields, which offers a straightforward approach to include calculated values directly, avoiding the complexities and limitations of the other options. This method would simplify data management by ensuring that essential data is accurately imported without the need for complex workarounds.
If the direct import of hard-copied values from formula fields isn't feasible, it would be beneficial to consider the following options regarding the macro and the fivetran_formula_model table:
- Enable the option to retain
fivetran_deletedvalues - Ensure all columns present in our raw tables exported from Salesforce are always retained
Thanks a lot and best regards,
Emre!
-
Official comment
Hi all,
We do have the ability to enable directly syncing formula fields using the Fivetran Rest API: https://fivetran.com/docs/rest-api/connectors/config#salesforce
Hopefully this solves the problem for you - if not, please do provide me with some details as to why now.
Best,
Sadie
-
Hi Emre,
Thank you for submitting this request. As you know, the problem with importing values directly is that Salesforce does not provide us with a way to detect when a formula field has changed. Therefore, through direct sync, we cannot guarantee data integrity. That being said, we are always looking to improve the coverage of our formula field translations so that we can meet all of your needs.
Can you provide some examples of the last two points you mentioned? What is a scenario where you need to retain fivetran_deleted values? What is an example where columns are excluded?
Best,
Sadie
-
This is actually quite important to us. Our salesforce team recently added a "health" formula to some of our tables. This formula is set up to change as we determine different aspects of the health of the data within. This different team handles this formula, so asking the data warehouse team to use FiveTran transformation is asking us to replicate the work and ensure we are in lockstep everytime the salesforce team identifies a health indicator.
If this is entirely impossible, then we would need to come up with a workaround, or have a completely different system for tracking the health. Both of which are unexpected.
Please sign in to leave a comment.
Comments
3 comments