ryan-d-williams / MMM-GoogleSheets

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

Module Displayed, Sheet Not #2

Closed jonnyscott10 closed 2 years ago

jonnyscott10 commented 4 years ago

Hi, the module seems to be loading okay no errors to be seen in the dev console but the sheet is not loading as can be seen on the following image

image

ryan-d-williams commented 4 years ago

@jonnyscott10 do you mind passing what your configuration looks like for the module? If your sheet data is private you can leave out the link otherwise I can try it out to see what's going wrong.

jonnyscott10 commented 4 years ago

{ module: "MMM-GoogleSheets", header: "Schedule", position: "top_left", config: { url:"https://script.google.com/macros/s/AKfycbyOLx0LB8ro-g8RiW4LAf7fsCbWeKgUUHfOSAp5wCz_kkVElimZ/exec", sheet: "Sheet1", range: "A1:B10", updateInterval: 1, // minutes },

ryan-d-williams commented 4 years ago

@jonnyscott10 it looks like you have a permission issue. When I click on your link, it requires a login (which it should not). If it requires a login when you click on it, that means it would also require a login when it is hit by magic mirror.

You need to remove the permissions of your script to get it to work. My best guess without seeing the way you set up the file is you missed this step in the installation procedures: In the menu that pops up, change "Who has access to the app:" to Anyone, even anonymous

Without this step, it would require login anytime you hit the link. With this step, anyone can run it just by hitting the link.

Let me know if that works / doesn't work for you.

jonnyscott10 commented 4 years ago

Hi, yes it seems it was set to public but not as me as a user, the module now shows undefined and I am currently researching this issue, if you want to have a look now you should be able to look at the script without logging in

ryan-d-williams commented 4 years ago

@jonnyscott10 when I run magic mirror with your config it works fine. Are you still having issues?

jonnyscott10 commented 4 years ago

@ryan-d-williams it currently is still showing undefined on the module

kalecream commented 3 years ago

Screenshot from 2021-02-05 07-50-36

@ryan-d-williams it currently is still showing undefined on the module

I'm also having this issue. It's saying something is wrong with line 11.

ryan-d-williams commented 3 years ago

@kalecream can you please post the config you are using?

ryan-d-williams commented 3 years ago

@jonnyscott10 I have tried that exact config again and it is working fine. Can you try making sure you config matches what you have above? If that exact config is working for me and not for you it is likely an issue with your setup.

kalecream commented 3 years ago
{
            module: "MMM-GoogleSheets",
            header: "Google Sheets",
            position: "top_center",
            config: {
                url: "[redacted]",
                sheet: "Dashboard",
                range: "C8",
            }
},

@ryan-d-williams, I'm sure the problem isn't our configuration, since we are getting this error (click on image below) from the google script library. It keeps pointing back to line 11 of the code from my last message. Screenshot from 2021-02-16 17-07-47

You can replicate the error by clicking on the URL that the other user provided. My URL leads to the same error.

ryan-d-williams commented 3 years ago

@kalecream clicking on the link it provides should provide an error. This is because you are not providing the sheet and range to the url, so it errors. If you want to have the link not produce an error, you can try the link with this format: url?sheet={sheetname}&range={range} so for example, the url from @jonnyscott10 above would be https://script.google.com/macros/s/AKfycbyOLx0LB8ro-g8RiW4LAf7fsCbWeKgUUHfOSAp5wCz_kkVElimZ/exec?sheet=Sheet1&range=A1:B10

Notice that if you click that link, you will get data as expected.

If you try to reformat your url with the correct format, what does it return? I cannot try it for you as you have not provided your link (totally fine if it has sensitive data, you will just have to do the debugging steps yourself)

ryan-d-williams commented 3 years ago

@kalecream also note that the module does this url formatting for you automatically based on the config file. What I said above is just for you to see if the url itself is working or not, you do not need to change your module at all.

Firephly commented 3 years ago

@ryan-d-williams Firstly excellent work on this, or at least so far and potentially.

if you saw my comment ignore it, i dont know what i did but it worked,

Excellent module i have so muched planned.

i will now be able to speak to my watch and it appear on the mirror. Isnt technology awesome, oh and people like you who make magic happen.