Pages

Thursday, October 29, 2026

CRM Analytics: Write Dataset to CSV file

CRM Analytics allows exporting a dataset into a CSV file and creating a lens as a values table. Ideally, the limit is 2,000 rows; you can extend more rows by change the lens to query mode, such as to 10,000 rows. But let's say you have 500,000 rows and many columns; it will not work.

You can use a recipe to write the dataset into a CSV file. In the output node, select Write To CSV, and  I prefer to select "Use fully qualified names in CSV header".


How to download the CSV file? Follow the following articles: Recipe Output to CSV and Export your Einstein Analytics datasets.

1. Query DatasetExport object
SELECT Id, PublisherInfo FROM DatasetExport

2. Query DatasetExportPart object
Sample query:
SELECT Id, PartNumber, DataFile FROM DatasetExportPart WHERE DatasetExportId = '0PxB0000000......' ORDER BY PartNumber  
Change 0Px.... to the DatasetExport ID from the 1st query. This also means the CSV files are split into multiple parts. Depending on the number of columns and characters, each part can be 10000 or 20000 rows.

3. REST Explorer
 Use Workbench or Salesforce Inspector; get the DataFile value from each row from the 2nd query and perform the REST query with a GET request, then copy the response into a text editor.




Reference:




No comments:

Post a Comment

Page-level ad