I have the next issue when exporting a CSV file to a SFTP location: It's about a daily automation, the process consists in three steps, one for data extract, a second one to convert the file to UTF8 and the last one is sending the file to the SFTP location. In case of data extension to have more than 1k records (the number is an estimate), the physical order of the records is changed. As the first line is very important in the project, this behaviour is generating an issue. The same data extension when not so many records is generating the right export. Did someone experienced this and have an idea how to fix it?

Thanks in advance!

  • 2
    You can add SQL Query Activity before the extraction to sort out records in the Data Extension with, for example, ORDER BY clause.
    – Niko
    Commented Jul 14, 2022 at 13:02

1 Answer 1


first time answering a question here!

In the backend Marketing Cloud processes the data extract in batches which don't get assembled into a file until the end. The assembly process might be optimised for speed but at the cost of guaranteed order of records. Unfortunately, this means that the order of records is not guaranteed. The OP's number of records gives an idea of how small the batches might be.

The solution suggested to a customer of mine that explicitly needed their records in a particular order was to engage Salesforce Services to create a "Custom Extract" activity (not free) or use an alternate ETL / Data / Middleware tool to reorder the data. My customer ultimately used Mulesoft to reorder the data that Marketing Cloud had jumbled up.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .