PRICING
PRODUCT
SOLUTIONS
by use case
learn more
BlogTemplatesVideosYoutubeRESOURCES
COMMUNITIES AND SOCIAL MEDIA
PARTNERS
Note: After adding new nodes in the Latenode chain of a project, to access the data from the previous nodes, you need to run the project and call the chain with all the necessary data. Data substituted from "JavaScript" node into "HTTP request" node often needs to be escaped with double quotes. Complex objects or arrays received in response to request from remote servers and coming as string must be processed by JSON.parse in order to work with them in "JavaScript" nodes as with corresponding data type.
First, let's make sure to get the token according to the instructions in our article, only in the list choose "Google Sheets API v..." scope "www.googleapis.com/auth/spreadsheets" and "www.googleapis.com/auth/drive";
Create a new table, you can for example call it "LatenodeTestSheet4Add", with two columns "ID" and "Name";
Let's substitute our token obtained from the step at the beginning;
Create a "Webhook" node: "+ Add node" => "Http" => "Webhook";
Copy the Webhook address and paste it into the rest client address bar;
Next, add another "JavaScript" node: "+ Add Node" => "Code" => "JavaScript";
Save;
Tie the nodes together;
Let's start and call the chain to transfer data between the nodes;
Let's copy the contents into it:
Let's check in all constructions like "data["{{1.body.name}}"]" that the number of Webhook corresponds to the one we are getting data from, if not replace it with the necessary one (let me remind you that 1 is the node number written just below the node name above the node type, then if it is a query then the object field responsible for the type of sent/received data is selected - body for forms or query for query parameters);
Save the changes;
Create the "HTTP request" node to get the id of the table file: "+ Add node" => "Http" => "HTTP request";
Save;
Tie the nodes together;
Let's start and call the chain to transfer data between the nodes;
Let's form the "Url" field: at the beginning let's substitute the variable "apiDriveURI" from "JavaScript", after it we specify ?:q=name "variable tableFileName from "JavaScript"";
Make sure that the default method is "Get";
Let's add the "Autorization" header and the "bToken" variable from "JavaScript" to its value;
Click "Save";
Create the "HTTP request" node to add data: "+ Add node" => "Http" => "HTTP request";
Save;
Tie the nodes together;
Let's start and call the chain to transfer data between the nodes;
Let's form the "Url" field: at the beginning let's substitute the variable "apiSheetURI" from "JavaScript", after it /spreadsheets/, after that substitute the value we got in the previous node {{ 3.body.files[ 0 ].id}}, and at the end /values/A:B:append?valueInputOption=USER_ENTERED&insertDataOption=INSERT_ROWS&includeValuesInResponse=true;
Change the method to the "Post" method;
In the body of "raw" let's substitute:
Let's add the "Autorization" header and the "bToken" variable from the first "JavaScript" node to its value;
Let's also add a "Content-Type" header with the value "application/json";
Click "Save";
Let's start and call the chain to transfer data between the nodes;
Check our table, there should be a new entry;
At the end of the whole chain in Latenode will look like this:
See you in new articles
Latenode
Google OAuth 2.0 Playground