IntegrationHub ETL - The Source Recency TimeStamp blocks Revisions to Transforms
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2022 01:52 PM - edited 11-08-2022 01:53 PM
I wanted to make some changes to certain transforms and fields in my target table.
(I am loading Exchange Distrbution Lists from AD)
However, when I ran the Import, nothing changed!
This was due to the Source Recency TimeStamp. This is a great feature - but it does have a gotcha.
I thought about deleting the records but I want to configure something that executes automatically
when my Update set is promoted - because I don't have Admin access to our PROD instance.
I therefore created a new transformed field called "updated_on" which is created
from the "u_whenchanged" field imported from AD.
I used a Multiple Input Script as shown below.
My Questions is: Is this best practice? Is there a better way to do this?
If it is a good idea - then can someone in SN write an Article?
I don't appear to have access to write Articles anymore.
/*
Problem:
The "Source Recency Timestamp" (SRT) field prevents records from updating when you change the Transforms and
deliberately want to make changes to the target fields - maybe due to a change or bug fix to your integration.
Resolution:
Set the field that you use to populate the SRT field to the max of the source when_changed" field and the time
when the change to the transform map ws uploaded to the current SN Instance.
If we don't do this, the records in the table never get changed when we change the field transformations.
*/
// First get the data/time when the updates were loaded into this SN Instance.
var grSource = new GlideRecord("cmdb_inst_application_feed");
grSource.get("name","Distribution List Import Automation");
var dateString = grSource.getValue("sys_updated_on");
var updateSetCommitDate = new GlideDateTime(dateString);
// Next set updated_on to the greater of whenChanged and sys_updated_on.
(function(batch, output) {
for (var i = 0; i < batch.length; i++) {
var whenChanged = new GlideDateTime(batch[i].u_whenchanged);
if ( whenChanged.after(updateSetCommitDate) ) {
output[i] = whenChanged;
} else {
output[i] = updateSetCommitDate;
}
}
})(batch, output);
- 777 Views