I’m having some trouble getting the proper response from Google Sheets using the KeyObject sheet type.
I set up the sheet in my config.js following the configuration tutorial which looks like this:
cms: {
GoogleSheetsCMS: {
spreadsheetId: '<sheetID>',
access: 'public',
sheets: [
{
name: 'responses',
type: 'KeyObject',
range: 'A:D',
position: 1,
},
]
}
I believe the problem occurs when I attempt to make a call to the sheet using a method. I define a method and use this.tell to reference the sheet. I’m not sure about the proper syntax for the response but I’ve tried using a couple of different techniques with no success. For example when I use the following notation I get an error message that says “Speech must not be undefined”:
method() {
this.tell(this.$cms.responses.key.secondKey);
}
I have also tried using an El expression like this:
method() {
this.tell(`${this.$cms.responses.key.secondKey}`);
}
However this returns undefined. I’ve doubled checked and the sheet name and keys are properly formatted; even the case sensitivity in my function appear the same way they do in the Google Sheet.
Is there any insight on why my method fails to return the desired text from the database? Perhaps I should format the syntax differently?
Any help would be appreciated!