How to get most recent item from a list

I created two virtual columns in my parent table to show “Checked In” and “Checked Out” and then created format conditions to highlight names of employees that were currently checked in. Worked great until I had more than one line of check in, check out.

In the VC I have this: [Related DEMO Personnel Time in Time Out Sheets][Check In Time]

Is there a way to write an expression that looks at the most recent row from the time table (child)?

I did also try this expression but it gives me the name not the timestamp.

MAXROW(“DEMO Personnel Time in Time Out Sheet”, “Check out Time”, [_THISROW] = [MACCID])

If I have someone that checks in and out multiple times I need a way to get the values from the most recent row so that all my formatting works.

I assume that “DEMO Personnel Time in Time Out Sheet” is a different table than the one in which your specified VC lives in

I am not aware of way that you can use MAXROW() AND dereference a value from the returned row reference. SO, I would handle this in two parts.

  1. Create a hidden VC for “Recent Row” and in the App Formula use your MAXROW() expression.
MAXROW(“DEMO Personnel Time in Time Out Sheet”, “Check out Time”, 
[_THISROW].[ID] = [MACCID])

Note the change from [_THISROW] to [_THISROW].[ID] - whatever the proper [ID] column is

  1. Now I would change your exisiting VC column expression to:
    [Recent Row].[Check In Time]

Am I creating the maxrow VC in the time table?

Sorry, no it would be in the same table as your current VC.

1 Like

Did you get figured out?

I think so! In the maxrow expression I had to change the col to rownumber instead of check out time and change the check in and check out columns from list to datetime and wa la! all the formatting and actions are working as expected!

Thank you so much!