Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
170 views
in Technique[技术] by (71.8m points)

Export filtered data from table widget Google AppMaker to a Spreadsheet

Does anyone know how we can export filtered data from Google App Maker table widget.

My table from the data source (no filter): that show everything

After applying some filter filtered.

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!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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) {
    ...
  });
  ...

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...