Add new row while retaining some row cells the same

Can a form component have some components designated ‘header info’ and others have ‘add’. When an ‘add’ component is selected then a new row is created in the sheet but carries over the ‘header’ info.

Time sheet app logs employee hours spent on a job and service code. In a day an employee can work on more than 1 job and service code. E.g. ‘John D’ worked 4 hours on Job A Service Code XY and 4 hours on same Job A but Service Code Z.

Currently users must create a new entry for each different job and/or service code for the same day. I can make a long form and have ‘Job 1’, ‘Job 2’, etc so that each row captures data.

However some employees work full day on the same job and service code.

I’m not sure I understand what you are asking. Are you saying that you want one row, but to allow the user to edit it if they want to add additional information? Or are you asking if for multiple rows per Job/ServiceCode, but you want some of the values to be automatically filled in?

If you have a list of jobs and the user can view the details of that job, then you can add the form button in that details view and carry over any values from the job into the the form via the Column Value components. Also, you can use the Special Value components to aquire certain values, like the signed in user’s email or the current datetime. Also you can set default values on some of the components.

In any case, a form will always write a new row and cannot edit an existing row. You would need the activate the edit button or add entry components on a details view screen.

Say you have 5 employees your submit for each day. Each of the 5 worked on (3) different ‘service codes’, this means that for the day you’ll make 3 entries for the 5 employees, however if you could enter their name, date and then make multiple entries for hours and service codes you save having to make a ‘new entry’ for each person. On the sheet you’d still see (3) rows for each employee.

What if you have 3 columns for service codes so each day is a single row?

If you wanted 1 form entry to create 3 rows, then you would probably need to incorporate some sort of script to handle splitting the data. Or maybe some sort of setup in a new google sheet with a query and/or transpose formula. It would get quite a bit more complicated on the back end.

if it was only service codes this would be an option to try, however there are 4 fields that need to be entered for each employee, so its 12 columns, I tried this option and it simply makes the form a long scroll

was hoping for a ‘basket’ type function, select employee and date then add hours, service code, etc to that employee/date then ‘check-out’ which would post a line for each combination of hour/service code

i’ve not written a script, i’ll explore option to have all entries in 1 row then use query to summarize, many thanks

1 Like

You can have it as sections in a form using visibility conditions. Would it work?

interesting, yes a good option, I can add a switch, ‘add more’ and then display next set of fields to enter, I like it, many thanks.

1 Like

You can have a copy here of my take on this.

many thank, this is great, nice resource for design

1 Like