Prepopulate a series of records and delete unused

My Roster table needs to have as a minimum fields for WorkDate Worker & Job.

I want to display a Roster (Roster View) for a selected Week with columns for Worker, and Monday, Tuesday, Wednesday โ€ฆSunday.
I can do this using a Slice based on my WorkerNames table with virtual colums for each day of the week using a formula like: something like: SELECT(SelectedWeek[Job],AND(([Worker] = [_THISROW].[Worker]) , Weekday([WorkDate])=2))

E.g. My Roster view would look like:
Worker Monday Tuesday Wednesday โ€ฆ Sunday
Charles Job001 _______ Job0002
Freddie ______ Job 0003

To edit a Workerโ€™s assignment from Roster view, I would click on a Worker Row to display a List of Jobs assiged to that Worker for each day, and with the use of Quick Edit columns I can edit assigned Jobsโ€ฆ

E.g. The List view would look something like
Worker Date____Job
Charles Nov 30 Job0001
Charles Dec 02 Job0002

The problem is, it will only display already existing Jobs - in my example it lists Nov 30 and Dec 02 but not Dec 01 because that record is not in the Roster table
So if I want to assign a Job to a new day, say Dec 01, I need to press the + (add) button to add a new record to my Roster tableโ€ฆ

Is there a way I can pre-poulate the Roster table making sure that there is one record for each day of the selected week, either with a Job assigned or a blank Job, so that it can be easily edited using Quick Edit from the list? Of course I would also need to delete blank Job records from the Roster table when I return to the Roster view? Or is there an easier way?

Solved Solved
1 8 308
1 ACCEPTED SOLUTION

Instead of creating all 7 then clearing out the extra; why not just create what needs to be created?

And in regards to looping actions (to create the multiple records you need) - that is a very involved process that probly would work better as a video.

There are some good posts in the community already about what people have tried and gotten to work beforeโ€ฆ

View solution in original post

8 REPLIES 8

Hello @Griff

This is absolutely possible with the โ€œbackground record creationโ€ action - as I like to call it.


If you create an action to automatically create the record inside the Roster table, you can trigger that from the form save event of the new job record.

This way, when you save a new Job record, a corresponding Roster record is created automatically as part of the โ€œflowโ€ of saving the new job.

Sorry for my tardy response. For some reason I didnโ€™t get alerts that a response was here. I will have a look at these comments and make sure I understand as soon as possible. Thanks

Thanks for the guidance.

Your code adds one record and makes it available for easy use. However I need to add 7 records, one record for each day of the week, so the user can easily fill it.

  1. How would I add 7 records and
  2. If the user only adds details for some days, is there a problem deleting the unused rows from the table at save time? That way I can run a script at night to delete all the empty rows to remove bloat

Instead of creating all 7 then clearing out the extra; why not just create what needs to be created?

And in regards to looping actions (to create the multiple records you need) - that is a very involved process that probly would work better as a video.

There are some good posts in the community already about what people have tried and gotten to work beforeโ€ฆ

Thanks. The example provided looks useful. I will adapt, but man is it complicated to prepopulate a few rows.

@Griff there are other ways to accomplish this, but they are just as involved and comlpicated.

One of the benefits of the AppSheet platform is that thereโ€™s

In fact thatโ€™s why I will sometimes ask a question when I know a solution - often you experts find much more creative, or simple ways of doing things.

Thanks again for your help.

@Griff Youโ€™re welcome

Top Labels in this Space