Writing Results to Google Sheets

I have a script that gathers data on API response times. In order to report results to the business I’m copying and pasting results from the Newman command line into a Google Sheet. Is there a way I can get my script to write directly to Google Sheets so I don’t have to manually copy and paste?

Thanks.

Hi @david.goldstein!

You sure can! Here’s a link to the Google Sheet API reference page – https://developers.google.com/sheets/api/.

From a workflow perspective, you should be able to store all of the different response times in a variable, and then parse/pass those value(s) into the API call to Google Sheets.

I was hoping for a code sample. Someone must have tried this before and can provide something to work from.

Hey David,

Can you please provide the script that captures API response times? Also were able to resolve the issue with writing in Google sheets?

Thanks
Satej C Mirpagar

@SatejMirpagar Doesn’t this line of code in the Tests script of each request, help you?

console.log(`${responseTime}ms`);

Thanks @sivcan, I need to redirect to a file to measure API response time.