0

I have a data model with a field for each month of the year, extending for a few years. I also have a table that displays the data in this model.

I am interested in updating the fields/columns displayed in the table widget based on the current date. I only need the table to display current and the upcoming 12 months not previous ones. For example, it if it March 6, 2018, I would want to have columns in the table for each month between March 2018 and February 2019. On April 1, however, the table should update to drop the March 2018 column and add the March 2019 column.

Is this possible or easy to do in App Maker? If so, what are some tips or relevant resources to look for in the documentation?

Carson Taylor
  • 45
  • 1
  • 4

1 Answers1

0

If I understand the question correctly then model fields are

  • Year
  • January
  • February
  • ...
  • December

and you want to display/edit values for them as following:

+-----+--------+--------+-----+---------+
| CM  | CM + 1 | CM + 2 | ... | CM + 10 |
+-----+--------+--------+-----+---------+
| V   | V + 1  | V + 2  | ... | V + 10  |
+-----+--------+--------+-----+---------+

Where CM is current month, CM + 1 is next month, V value for current month V + 1 is value for the next month, etc...

The most straight forward and easy way to render such UI will be rendering two tables for two records (one for current year and one for next year) and glue them together by playing with CSS styles.

More elegant solution will be dynamic table rendering. This technique is described in answer on this question: Accessing data in Google Drive tables with Google App maker (option #4). Basically you can add two grids to a page, one to render months' names and another to render values for months. You can bind those grids to Calc Model(s) or Custom Properties.

Pavel Shkleinik
  • 6,298
  • 2
  • 24
  • 36