How to pick a random row from Google Sheets using Sheets Node?
const newItems = ; random_row = items[Math.floor(Math.random() * Math.floor(items.length))]; newItems.push(random_row); return newItems;
Please note that using this code in the Function node will only return one random row out of the list of the rows returned by the Google Sheets node. Hope that helps!
Worked after adding a Function node next to Google Sheet. Thanks, @tanay for your quick response
Great to hear that helped. Have fun!