Hello Airtable community,
I am new to Airtable and still learning javascript, reading trough this community has been very helpful so far.
However, I can not find a solution to what seems to be an easy task. Please help.
Working with 3 tables:
-
dayTable
-
shiftTable
-
scheduleTable
-
In dayTable records are automatically created based on the script and automation which I created (the user picks the week start date, then the formula calculates 7 days and finds all dates in between, and then creates a record for every day in another table = dayTable, in dayTable weekday formula is showing me what day it is
-
In shiftTable shifts are created, some shifts are every day, and other occasional which is determined with single select field. For occasional shifts there is a multiple select with 7 options (1 for each day)
-
In scheduleTable there is 1 record for each day+shift, (for example there are 2 everyday shifts, and in scheduleTable Moday has 2 records - Monday morning and Monday evening, and those records are created automatically using scripts and automation, this is where I got so far)
I would like to include a script that checks a dayTable for a weekday cell value and shiftTable for multiple select values and if multiple select contain a value that is the same as the weekday value (for example Friday) then a new record should be created in the shifts table.
Seems to me like I would have to get value as a string and compare it to a value of a weekday but can not get it right. Multiple select is an array of objects, how to access single-cell values? I am trying to find a solution like record.getValueAsString(‘multiple select’).name but can not figure it out. As I said still learning javascript, please help!
Thank you in advance :grinning: