0 votes

I'm looking for an example how to export Efficy content to CSV File using Datasynchro
In Efficy Help I found only an example to export to Excel file

Thanks

asked in How to by (103 points)

1 Answer

+1 vote

Hello

You can build a CSV file in memory in using a DataSynchro script. This is explained on this Project guide, see topic 9.1.

Here is also a minimalistic version of the export script you can add to export from a query the K_CONTACT and NAME of a contact.

var ExportList,
Folder = "C:\\temp\\";

function EfficyExportRecord(SourceDataSet, DestDataStore) {
  ExportList.Add(SourceDataSet("K_CONTACT") + "\t" + SourceDataSet("NAME")); 
  return false;
}

function EfficyStartJob(SourceRecordCount) {
  Efficy.log("Job has started, count: " + SourceRecordCount);
  ExportList = TStringList.Create;
}
function EfficyEndJob(SourceRecordCount) {
  Efficy.log("Job has finished");
  var file = Folder + 'MyExport.csv';
  ExportList.SaveToFile(file);
  ExportList.Free;
  Efficy.log("Saved to file " + file);
}
answered by (6.8k points)
Hello,

that seems very interesting. I will do some test next week and I will give you a feedback of my results.

Thanks for your help
Welcome to Efficy Overflow, where you can ask questions and receive answers from other members of the community.
1,166 questions
1,424 answers
1,715 comments
325 users