so when the customer press join so the sheet will add his name and num and his num people added to the box by him will be added to the exisited no people in the sheet
and the viceversa when he cancel, his data only will be removred and his no people type will be substacted
i couldn't find it yet
this is the update code
//UPDATE SINGLE RECORD
else if (e.parameter.func == "Update") {
var ss = SpreadsheetApp.getActive();
var sh = ss.getSheets()[0];
var data = [ [ e.parameter.name, e.parameter.phone ] ];
sh.getRange("B"+(parseInt(e.parameter.id)+1)+":C"+(parseInt(e.parameter.id)+1)).setValues(data);
return ContentService.createTextOutput("Success");
}
i wanna adjust it to add new cells in the row not just updating
can i make geenral text boxes so to not to make at leat about 6 new textboxes
forexample,
customer 1 name& number
customer 1 location
customer 2name& number
customer 2location
so to not to make 6 text boxes i wanna make a text box so any additional customer can fill and not affectiong on the prefilled other addional customers?
It sounds like you want to put all your customer details into one cell/parameter.
You can do this and either rely on the user following a strict pattern of entry, or provide a customer entry dialog that allows the user to add customers to a list, which is then reflected in a single textbox and can be sent as a single parameter to your spreadsheet.
let me make a quick view its about to collect customers travelers numbers
the main customer ordered his request and i made a big dhashboard listview having all customers orders so when the new customer see that list view elements he can pick and join forexample:
the first additional customer :
when he mark the check box and added the num of join that num will be added to the no of travelers orders so if the orders no of people is 2
and the addional customer added in the spinner a number for example 1
so in the list view the no of people will be 3
and the additional customer data will be added as you showed me
i wanna make that as i wanna collect the num of travelers for each car whatever the max will be 7 for the van or 14 for the micro-bus or 4 for the taxi
i hope you get me as its my final step in my project
yes after the main customer make the orders
all orders will be collected in a main listview
so if additional customers wants to join
the no of people will be = the existed + the new no of people will be added by the addional
and in the below of the listview selection will add the customer name,number and location so on
so if a second customer made these steps will be listview selection
the main orders
no of people updated= main no of people+ no of people1= no of people 2 so on
and the listview selection below
customer 1 name, num and location
customer 2 name, num and location
so on
so when the driver pick the list view after the no of people completed he can connect with them by num and location,
thats all
There are possible collision issues with this, for example if two customers try to add their details at the same time. You can lock the spreadsheet while one user is adding their details, but you would then need to handle the other user who cannot add their details because of the lock.
The four data will be added from the additional customers, 3 will be got from their tinydb name, num and location and the last one is the no people he will add
that four data will sent to the 4 textboxes and being added to the listview general and the same for the additoinal customer 2, 3 ,4 so on.
i wanna collect the cars people numbers until being full to call customers that the travel is ready
When I get the time, I will write a guide on how to use the lock service on google apps script which will help to avoid concurrent collisions when adding/appending data to a spreadsheet row/cell.