I'm looking to generate a JSON file containing specific information and then send it via AppsScript.
var dataObject = {data:[]};
var items = [];
//initiate loop
for (let i = 0; i < 3; i++){
items.push({
id: i+1,
name: "sample"
})
}
dataObject.items = items;
Logger.log(JSON.stringify(dataObject));
//DriveApp.createFile('New Json File', JSON.stringify(dataObject), MimeType.JSON );
Include code here for creating a JSON file and sending it to a specified recipient.