I found myself wanting to create a blank hidden table today just to use the export to excel function. Is there a way to create a button to export all the fields from a model using the same functionality as the table export? (just without the table)
Separate question, is there a way in the javascript exportData to give an alternate name to the fields you are exporting, the way there is in the export options on the table?
+1 - This would be very helpful.
Brayden, you can do this by override field metadata on the model and giving your fields new labels. I use this code to get at the field labels, but I’m not sure it’s necessary any more, they’ve fixed some things in the export code.
var $ = skuid.$;<br>var today = new Date();<br>var model = skuid.model.getModel('YourModelName'); <br>var fields = e //use the api names of your fields here<br> 'Index',<br> 'Id',<br> 'Name', <br> 'CustomField__c' <br>]; <br>var fieldsWithCorrectLabels = $.map(fields, function(v){<br> var actualField = model.getField(v);<br> console.log(actualField.id);<br> <br> return {<br> id: actualField.id,<br> name: actualField.name,<br> label: actualField.label<br> }; <br>}); <br>model.exportData({<br> fileName: 'Custom Export File Name '+today,<br> fields: fieldsWithCorrectLabels,<br> doNotAppendRowIdColumn: true,<br> useAPINamesForHeaders: false<br> });
H/T to skuid support for unofficially helping with this
Note: “Index” is a UI-Only field I made with the formula {{index}}, which gives you the row number in a column.
Hey @Greg_Huete !
In case you missed it, Skuid has implemented an easier way to export data in the new Chicago release which is now available on the Skuid Releases page. Best practices for upgrading can be found in Upgrading Skuid on Salesforce. As a reminder, Salesforce does NOT allow reverting back to prior versions of managed packages. Skuid always recommends installing new versions in a non-business critical sandbox environment to test all mission-critical functionality before installing into a production environment.
We also recommend that you update out-of-date themes and design systems after you upgrade. Please let us know if you continue to encounter any problems with this issue after upgrading.
Thanks,
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.