I'm trying to read a cell in a GoogleSheet, the value of that cell is used to update a variable in SL360.
I am trying to use the widget to read a value in one cell within a GoogleSheet file. I then want a variable in SL360 to have the value of what that cell is, in this example: 'Valid' and then I will use it to trigger what happens next within the module.
I have tried to follow the steps for the SheetsGet but that has not worked, for example:
The column in the GoogleSheet is called: status The variable in SL360 is called: LicenseStatus
I have created the JS trigger: SheetsGet('status', 'LicenseStatus');
It doesn't seem to transfer the value from the Sheet and I have added the other variables required for the widget to run as per the instructions and given access to the sheet as instructed.
Has anyone got any work arounds or know why this may not be working?
Thanks in advance.
Reply
Posted on 4/11/2025
Please type your reply.
@support
Are you trying to read from a row that already exists? A new learner will automatically get a new row in the spreadsheet, which starts out blank, so by doing SheetsGet('status', 'LicenseStatus'); you're reading from a column 'status' but in a blank row. You can override that by changing the variable stencilsheetstoken to the row number that you need, but then keep in mind that all subsequent operations will also be occurring on that row, unless you change stencilsheetstoken agian.
Reply
Posted on 4/11/2025
@elearningdevteam
Hi, thanks for getting back to me.
So yes, everytime the module is launched I want it to take the value in cell A2 and set it as a variable in Storyline.
So would I right in saying the stencilsheetstoken text variable should have the default value of A2 or would the javascript code need to be changed?
Many thanks.
Reply
Posted on 4/11/2025
@support
2 not A2. stencilsheetstoken is a row number.
Reply
Posted on 4/11/2025
@elearningdevteam
Thanks, I have changed that and tested it again but nothing displayed still.
Apart from the variable, does it need changing elsewhere?
Just to confirm, I have the following variable set up:
Name: stencilsheetstoken Type: Text Default Value: 2
Reply
Posted on 4/11/2025
@support
Another item you can check is whether the widget has loaded at the time you're trying to use it. For example, if both triggers (to load the widget and SheetsGet) occur when timeline starts, the SheetsGet is not yet defined as the Internet is not instant and it takes a second or two to load the widget.
If you want, you can upload your story file and we'll check what's wrong. We don't need your entire project, just that one slide with triggers.
Reply
Posted on 4/11/2025
@elearningdevteam
Thank you, I've been able to get it to work - it was all around the time it needs to run and trying to plan that into the project I will use it in. Thanks for the assistance.