Export to Excel without a table

David, we are working on adding some options to Export to Excel in our upcoming release or the release after that, but ultimately we will only be able to let you export a theoretical max of 10,000 records using the Skuid-based export approach, due to limitations in how many “offset” records can be retrieved and limitations in Apex JSON Heap Size. Current state today, it would take some custom JavaScript that uses the Skuid Model API to achieve a “Load All” functionality.

Hello Zach,

I have another question related to the exportData method.  This functionality has been very beneficial in allowing us to export data that has not yet been saved in the model.

Is there a condition that can be set when calling the method so leading zeros in text fields are not truncated?  We have department numbers like “000220” that are converted to “220” when exported.  

Thanks for your help.

I’m pretty sure that it is Excel,  or whatever tool you are using to open the file that is stripping out the leading zeros.  You can test this by openining your downloaded file in a text editor and validating whether the leading zeros are there.  You can configure how Excel does the data import from the CSV.  See this document:  http://superuser.com/questions/431637/why-is-excel-removing-leading-leading-zeros-when-displaying-cs…

Hello Zach, 

We have implemented a custom export button that calls the exportData() method on our model, the problem is our customer requested for the record ID to not be included in the exported file. I have tried including the fields parameter with the hopes it would only export the fields I specified, but the record Id is still appended to each row in the generated export file. I know you can remove the option to “append record id column” for the standard export button on a table, but is there a way to turn off this option via a parameter in the exportData() method?

Thank you.

What is the best way to get record names rather than ids? For example I have a custom object table that has lookups to a user and an account. It is exporting the account id and user id rather than their names. 

Do I need to use the solution above rather than the standard export to excel functionality?

Thanks!

Ryan, the export process by default exports BOTH the lookup record’s Id and Name. You can circumvent this by only requesting the Name field in your export, e.g. using the example above / in the docs, request model.getField(‘User__r.Name’) and model.getField(‘Account__r.Name’) rather than model.getField(‘User__c’):

var model = skuid.model.getModel(‘MyModel’);
model.exportData({
    fileName: ‘MyFile’,
    fields: [
        model.getField(‘Name’),
        model.getField(‘User__r.Name’),
        model.getField(‘Account__r.Name’)
    ]
});

Yes Ross this is possible, just set the parameter doNotAppendRowIdColumn: true when calling exportData(), see the docs on exportData() for more information.

Thanks Zach. For some reason mine is just exporting the lookup ids though. I will try the other method. 

Perfect!  Thanks so much Rob.

Thank you, this is exactly what I was looking for!

Has anyone made any custom export field “Picker” that would allow the end user to choose what fields from the model to export?

My users are asking for a way to export the table data but choose different fields depending on the scenario. Any ideas I can run with let me know.

This post is extremely helpful! Thanks all…

Just thinking out loud here, but maybe you could do a a whole slew of UI-only fields that are checkboxes, that have the same API name of the fields you want. I think you’d want to have a model that has no fields except these UI-Only fields. 

Then in the JavaScript, if there’s some way to “get all the fields in this model”, you could iterate through the fields. I’m not at all a JS developer, but here’s the kind of code I would try, after getting all the fields in a given model in an array called modelFields (not even sure THAT is possible)

 fields: [ $.each(modelFields, function(){ var currentFieldName= this.Name; model.getField('currentFieldName') } ]

When did “Export Columns” become an option!? Or have I been overlooking it this whole time? That’s a great feature!

So many features,  so little time!   Glad you like them.   I believe export columns was a Superbank thing. 

Hi Zach,

I also used :

var model = skuid.model.getModel(‘LeadData’);

model.exportData({<br> fileName: 'MyFile',<br> additionalConditions: [<br> { field: "IsConverted", value: false, operator: '=' }<br> ]<br> }); That code for export. That export work perectly when i am doing testing inside salesforce. But once i use that same page in Force.com Site then its redirecting me on <b>/apex/ExportData page. Can you please let me know how can we do export in force.com site using a custom button. Thanks, Rajendra</b>

Hi Zach,

I got it answer here:

Before you can reliably use the skuid:page Visualforce (VF) component approach, there is a post-install configuration step you will need to take to guarantee that your Skuid Pages will behave exactly the same as they would if you were taking the Redirect approach:

You must find the following 3 VF Pages that come in the Skuid app / managed package, and create a local clone of each of them with the exact same name:

  1. ExportData
  2. UploadImage
  3. Include
http://help.skuidify.com/m/page-assignments-and-overrides/l/201793-using-the-skuid-page-visualforce-component-to-run-skuid-pages

Thanks,
Rajendra

is there a way to implement the “Attempt to Load in All Records Before Export” check box while using exportData()?

Matt,

Check out->  loadAllRemainingRecords

https://docs.skuid.com/latest/en/skuid/api/skuid_model_model.html

Thanks,

Bill

Thank you! I don’t know how I missed that in the documentation.

Is there a way to export a list of the conditions on a model and indicate which are activated and deactivated?