Training - Only allow individuals trained on documents to train others on the same documents

Hi everyone, I’m trying to work on one of the more complicated expressions I’ve ever attempted in Appsheet. The purpose is to look for a table of training records where a single cell contains a enumlist of document records spread across multiple rows (for example one row can have ‘Dave’ trained on document list ‘Forklift Inspection, Truck Inspection’, while another row can have ‘Steve’ trained on just ‘Forklift Inspection’. This information is in the ‘Trainingref’ table.

I want to then take that information, and cross reference it with the ‘trainer’ column in the active spreadsheet (the ‘Training’ table), to ensure that for Steve to train on ‘Forklift Inspection’, he himself already has a training record on said document, and no documents where he/she are not trained on will appear. The ‘Training’ table is a parent table, and the ‘Trainingref’ table is a child table that is set to REF / is a part of. All training documentation referenced by these tables are in a master document table (QMS Slice Super), where the document names are stored as unique, single text entries (not grouped lists), e.g ‘Forklift Inspection’ has its own key record, and Truck Inspection’ its own etc etc.

To try achieve this objectives I’ve started with a Select function that looks in one table slice, and cross references it with a condition from another table, with yet another condition from a third table.The current code gives me no errors, however it is not performing the function as I’ve definitely made some mistakes with the references (or lack thereof). The code is as follows:

SELECT(QMS Slice Super[Documentrev], AND(CONTAINS([Trainers], Trainingref[Trainee]), CONTAINS(Trainingref[Documentrev], QMS[Documentrev])))

This is my screencap -

I’m not sure what the best course of action is here, and any help would be greatly appreciated. You guys are great!

Thanks,
D

0 10 286
10 REPLIES 10
Top Labels in this Space