S3 upload option to "delete all" records in an MDA table before inserting new data records

  • 4
  • Idea
  • Updated 1 day ago
We've got an issue that probably most customers have or will run into at some point.  

When we get S3 uploads and it's updated or new data records, S3 insert/upsert works just fine.

But if there is an absence of data that was previously uploaded to S3, there's no way to clear those records.

Would be incredibly helpful to have a "delete all" option to delete all the records in an MDA table before S3 upload job processes so that we can insert the entire fresh export of data.

Has anyone else found a way to get around this issue?
Photo of Jeff Kirkpatrick

Jeff Kirkpatrick, Champion

  • 24,324 Points 20k badge 2x thumb

Posted 6 days ago

  • 4
Photo of Sagan Sherlin

Sagan Sherlin, Champion

  • 3,398 Points 3k badge 2x thumb
+1 This would be awesome!  Right now it's a two step process...and if your forget to delete all the data at first.  Well. More work!  
Photo of Mark Gecsey

Mark Gecsey

  • 484 Points 250 badge 2x thumb
+1 for us as well. 
Photo of Dan Ahrens

Dan Ahrens, Official Rep

  • 23,636 Points 20k badge 2x thumb
Hi folks, 
I wanted to share here an idea that Jeff and I had a chance to discuss via the phone. Since invariably once you drop a table, a few weeks later someone will want historical data, one way to 'get the best of both worlds' would be this approach. 

Assumptions:
* You get a daily (or weekly or other regular cadence. For this example we'll use daily.) update file that is the entire data set and is not just incremental updates.
* The data file you are working with does not identify which records are to be deleted - they are just not present on the first cycle where that record is no longer valid

Approach:
* Add two columns to your MDA file: "Date last updated" (date type field) and "Current" (boolean)
* Create a rule that runs daily before your daily import that sets the value of "Current" for every record in that MDA object to null
* When you import your daily file, upsert your new data to the MDA object and also write the rule date to the "Date last updated" field and set the "Current" field to not null.

This will accomplish two things:
* You'll immediately be able to filter any current records by using that boolean "Current" field
* You'll have a historical record of the last time any individual records were updated