Send parameters to google sheets through API

99 views
Skip to first unread message

Max Forsey

unread,
May 4, 2022, 6:09:09 PM5/4/22
to Dialogflow CX Edition users
hello,

I am trying to send my session parameters to a google sheet through the google sheet API.
All I need to do is update the row of the google sheet by changing what I put in the row, Then I call an append sheet row function.

So far, I am able to put normal strings in the row but when I try to use the session parameters it fails.

 I know that session entities can be various formats but I am just trying to send the session entity @sys.phone-number which has the output of string.

This is what I have now which does pass the string to sheet(it works). 
  var row = ["This string is passed to google sheet"  ];
 appendSheetRow(jwt, apiKey, spreadsheetId, range, row);


I have attempted to do this(which does not work):
 var row = [req.body.sessionInfo.parameters.phone  ];
 appendSheetRow(jwt, apiKey, spreadsheetId, range, row);




Eduardo Ortiz Caraveo

unread,
May 5, 2022, 2:30:39 PM5/5/22
to Dialogflow CX Edition users
Could you format your code something like the example below?

const {phone} = req.body; await googleSheets.spreadsheets.values.append({ auth, spreadsheetId, range: "test1!A:E", valueInputOption: "USER_ENTERED", resource: { values: [ [phone] ], } })
Reply all
Reply to author
Forward
0 new messages