hey y'all :waves: i'm using <tap-salesforce> and <...
# plugins-general
r
hey y'all waves i'm using tap-salesforce and target-redshift. extractor is set to select
Account.*
as well as
AccountHistory.*
. i noticed that
AccountHistory.OldValue
and
AccountHistory.NewValue
columns aren't persistent in the
AccountHistory
table, but rather, the relevant row in
Account
is updated. this behavior is fine but i'd like to also keep
OldValue
and
NewValue
columns in the
AccountHistory
table. is there a way to do that? edit: added target plugin for more context
w
With Salesforce you have to explicitly define the fields you want history tracked on. If that isn't turned on then the column value will just be updated on the Account object. If history is turned on for the column then the value will be updated on the Account object row as well as a row being created in the history table.
r
if i'm understanding correctly, i would need to explicitly list the select values for account history:
Copy code
select:
  - Account.*
  - AccountHistory.AccountId
  - AccountHistory.CreatedById
  - AccountHistory.CreatedDate
  - AccountHistory.Field
  - AccountHistory.Id
  - AccountHistory.IsDeleted
  - AccountHistory.NewValue
  - AccountHistory.OldValue
w
Yes, you would need to do that
r
awesome! thank you so much for the insight
w
But what you were originally describing sounded more like the internal Salesforce behaviour that generates the row in the Account History table
I may have misunderstood though
r
oops! i probably could have done better with the question. in the destination table, all the columns for
AccountHistory
show up except for
NewValue
and
OldValue
. i'd like those columns to stay persistent in the destination table, not just update the row in the
Account
table
w
This is a good tool that can help you see the underlying data inside of Salesforce: https://workbench.developerforce.com/l
I am not following
Old Value and New Value are a set of six columns in Account History
NewValue__bo NewValue__do NewValue__st OldValue__bo OldValue__do OldValue__st
You need to select those in your manifest.yml
r
interesting. are those values documented somewhere for reference?
w
I am running out but can follow up later tonight or tomorrow
I am certain they are in the Salesforce documentation somewhere
r
ok 👍 i'll take a look
w
But if you look at the Account History table via Workbench (which I linked to above) you should see them in there I believe
s
@rafa just checking, if you were able to resolve it? I am also facing the same. I am seeing this for OpportunityFieldHistory Object, tap-salesforce doesn't gets me OldValue and NewValue.
r
hey @sushant_mittal, the quick solution for us was to utilize dbt snapshots to create a slow changing dimensions table. the alternative was to build a custom tap using meltano sdk.
s
Thanks @rafa, I will use dbt snapshots for this use case. Custom tap design is a long process. dbt is much easier.