Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function loopThrough(records){
var myDateString = Utilities.formatDate(new Date(),"GMT", "yyyy-MM-dd");
for (var i = 0; i < records.length; i++) {
var formattedDate = records[i].updated_at.substr(0, 10);
var now = new Date();
if (formattedDate === myDateString) {
now.setDate(now.getDate() + 30);
var stringDate = Utilities.formatDate(now,"GMT", "yyyy-MM-dd");
updateDate(records[i].id, stringDate);
}
if (records[i]["form_values"]["8302"] === myDateString){
updateStatus(records[i].id);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment