Restricting Entries to items that have not had an entry in the past time period

I have two Tables, Freezers, which contains the Freezer Master Data, and Temp Check which contains the Temperature check records.

I want to allow users to enter temperature records for valid freezers(ones in the master data table), but not unless at least 30mins have past since the last temp check. This is to ensure that a user doesn’t keep entering the temp check over and over again.

I have the basic one for ensuring the freezer enters a valid master data freezer, but having issues getting the time restricted part.

so far I have been trying the following in the VALIDIF -

NOT(IN([_THIS], SELECT(Temp Check[Freezer ID], [Checked Time] < TIMENOW()-“30:00”))),

but not getting very far…

Any suggestions would be highly appreciated…

0 6 261
6 REPLIES 6

Please try below.
Please have [Checked Time] as datetime type column instead of just a time type column. This will ensure any rollover from one date to another date if it so happens will not produce incorrect results.

Then the valid_if of the [Checked Time] column can be
MAX(SELECT(Temp Check[Checked Time], [Freezer ID]=[_THISROW].[Freezer ID])) < [Checked Time]-"000:30:00"

Many thanks for your response, Suvrutt…unfortunately, it still allows the same freezer to be input immediately afterwards, so doesn’t work…interesting formula though, but still back to the drawing board…

have the DateTime column already in the table so it was an easy thing to switch the formula and try it…

Thank you for the update. As I normally do for such bit intricate solution suggestions, I may update you that I tested it before suggesting and it perfectly works for me. I again checked it just now before responding to you in this note as well.

One thing you may wish to note though. In my testing the child record ( Temp Check table) is saved. So that record’s reference is available for cheking valid_if condition for next [Temp Checked] data entry.

As shown in the below image ,if I try to add a child record within 2 minutes of the previous entry, the valid_if of DateTimeEntry column does not allow reentry of new record. in this case, I am adding an “order Details” child recod to an “Orders” table parent record.

I can share a video also of the date entry if so required.

Ahh, now i understand…you are putting the ValidIF in the checked Date column, I have been using it in the Freezer ID column instead to restrict entry for freezers that have already been checked within the 30min period…

Interesting approach, I could use this method by adding a validation Column that checks the date and only allows saving if the freezer has not been checked in the past 30mins.

I had hoped to get the error the moment the freezer ID is scanned, thus allowing the user to reenter another freezer that has not been checked. (The freezer IDs are scanned via QR codes)…

Got it at Last!

Didn’t use your formula, but used another method based upon your solution above, many thanks!

I created a virtual column called vValidFreezerEntry, and tested the Checked DateTime there with the below formula -

IF(
LOOKUP(MAXROW(“Temp Check”,“Checked DateTime”,[Freezer ID]=[_THISROW].[Freezer ID]),“Temp Check”,“Inspection ID”,“Checked DateTime”)

<[Checked DateTime]-“000:30:00”,

“ValidFreezerEntry”,

“NotValidFreezerEntry”)

then the ValidIF in the Freezer ID column was set to -

AND(IN([_THIS], Freezers[Freezer ID]), [vValidFreezerEntry]=“ValidFreezerEntry”)

All works as it should…I will look at seeing if I can do away with the Virtual field later and incorporate the entire two steps in one ValidIF to make it more compact and elegant, but this works for now…!

Many thanks for your help and for setting me on the right path!

keep scmilin’!

Mark Wilhelm

Thank you for posting the update and nice to know you solved it per your requirement. All the very best with your app creation.

Top Labels in this Space