ryan-d-williams / MMM-GoogleSheets

Google Sheets Module for MagicMirror
MIT License
27 stars 2 forks source link

Auto update formulas on sheet #22

Closed McLoud2014 closed 1 month ago

McLoud2014 commented 2 years ago

Right now I am using MMM_GoogleSheet to display a list of daily chores on my MM. The list is broken down by kid and the chore changes each day. The google sheet has formulas that lookup the date from a chart and pulls the correct name based on the parameters. The issue I have is the google sheet will not update unless I have the sheet open.

Is there anyway to force MM to refresh the sheet? Or a script I can put in google sheet that will refresh every so often?

Here is my config: { module: "MMM-GoogleSheets", header: "Daily Chores", position: "bottom_left", config: { url: "my url id removed for privacy", sheet: "Sheet2", range: "B3:C9", updateInterval: 1, // minutes requestDelay: 250, // ms cellStyle: "flat", stylesFromSheet: ["font-size", "font-style"], } },

here is the css: .module.MMM-GoogleSheets header { font-size: 30px; line-height: 30px; }
.module.MMM-GoogleSheets { margin-left: 400px; background-color: rgba(255,255,255,0.4); border-radius: 8px; padding: 8px; color: #000; Height: 268px; width: 355px; text-align: center; line-height: 20px; }

ryan-d-williams commented 2 years ago

This is a great idea! I will add this to the next iteration.

ryan-d-williams commented 1 month ago

@McLoud2014 this change has been added, thank you for the recommendation. I confirmed that with the file closed, the script still updates the formulas.

Note that you will need to update to the latest version of the google apps script library to see the changes. You can follow the steps in the README under "Updating the library".

Please send me screenshots of you using the module so I can add them to the README as inspiration for others.