Does anyone know how we can export filtered data from Google App Maker table widget.
My table from the data source (no filter):
After applying some filter
.
I manage to export everything to Google Spreadsheet (see this SO answer), but I am stuck on exporting only the data after applying some filter. Really appreciate if anyone can share the solution. Thanks!
The AMU Library can do this in one command in a button onClick.
The button just needs to be on the same datasource as the table.
Simply:
AMU.export.toSpreadsheet = function(widget, Your_modelName);
It seems that you are looking for filters. It should work if you modify script from this answer to something similar to this:
// Server script
function dataExport(filter1, filter2, ...) {
// TODO: Check permissions.
...
var query = app.models.MyModel.newQuery();
// TODO: Apply user/roles specific filters for
// security reasons.
query.filters.Field1._equals = filter1;
query.filters.Field2._greaterThan = filter2;
...
var filteredRecords = query.run();
filteredRecords.forEach(function(record) {
...
});
...