I'm trying to create a registration form that can be imbedded into our club website for users to sign up to our sessions with.
I need the form to be updated via the back end database which i'll add triggers and data formating etc in due course.
My issue for now is the dates on sheets are displayed as i'd like "03-Jul" but once my script has run they appear on the form as a full date and timezone stamp. I'm sure i just need the script to treat the "date" as a string instead of a full date/time value. can anyone advise what to change in my script to achieve this please.
TIA
function main() {
var labels = wsData.getRange(1,1,1,wsData.getLastColumn()).getValues()[0];
labels.forEach(function(label,i){
var options = wsData
.getRange(2, i + 1,wsData.getLastRow()-1,1)
.getValues()
.map(function(o){ return o[0] })
.filter(function(o){ return o !== "" });
updateDropDownUsingTitle(label,options);
});
}
function updateDropDownUsingTitle(title,values) {
var items = form.getItems();
var titles = items.map(function(item){
return item.getTitle();
});
var pos = titles.indexOf(title);
if(pos !== -1){
var item = items[pos];
var itemID = item.getId();
updateDropDown(itemID,values);
}
}
function updateDropDown(id,values){
var item = form.getItemById(id);
item.asListItem().setChoiceValues(values);
}