clock in/out with last records display

Hi All,

I'm quite new to appsheet. I'm trying to make an app to clock-in and out using NFC/QR by simply scan and using the time stamp. Everything works, but I wanted to display the last says 5-10 records of people who have scanned underneath the scan field within the same view (UX).

Any help is appreciated.

Cheers,

Solved Solved
0 11 233
  • UX
1 ACCEPTED SOLUTION

Okay. Your exact requirement is clearer now. Please try below.

1) Please create a slice with an expression of 

IN([Unique ID], TOP(ORDERBY(SELECT(TimeIn[Unique ID], [Person Email]=USEREMAIL()),[Time In],TRUE),5))  Say this slice is called "Last5Records"

2) Please create a VC on the table with an expression something like Last5Records[Unique ID]

Say this VC is called [Your Last 5 Time ins]  The type of this VC column Should be-  type as LIST, element type as Ref and Referenced table name as  "Last5Records".

Please place this VC below the scan column in the form. It will show the latest five time in records for the user who is scanning his/her QR code.

 

View solution in original post

11 REPLIES 11

In general, you could create a slice using TOP(), and ORDETBY() functions.

ORDERBY() will get you the records sorted descending by Timestamp and TOP() will help you get the desired number (5- 10 as you mentioned) of those sorted records.

You could base your view on that slice.

I tried 
TOP(ORDERBY(TimeIn[Unique ID],[Time In],TRUE),5)

It gave me an error "The expression is valid but its result type 'List' is not one of the expected types: Yes/No"

Just to clarify, I wanted everytime someone scan thei name and time appears at the ver top (under the scan field)AppSheet UX.PNG

If i may ask, which type of tags or card you are using for the clock in and out ? 
am planning to do something similar but still not sure what to pick. 


I use sticker 13.56MHz

Okay. Your exact requirement is clearer now. Please try below.

1) Please create a slice with an expression of 

IN([Unique ID], TOP(ORDERBY(SELECT(TimeIn[Unique ID], [Person Email]=USEREMAIL()),[Time In],TRUE),5))  Say this slice is called "Last5Records"

2) Please create a VC on the table with an expression something like Last5Records[Unique ID]

Say this VC is called [Your Last 5 Time ins]  The type of this VC column Should be-  type as LIST, element type as Ref and Referenced table name as  "Last5Records".

Please place this VC below the scan column in the form. It will show the latest five time in records for the user who is scanning his/her QR code.

 

@Vannak_Soth I was just working on something similar by chance. 

Hussein_Osseily_0-1666006184545.png

Scan a NFC Tag, show a list of the last 5 Records 
If this is what you want , I could acheive this by creating a Virtual column, column type LIST in the form table using this expression; 

FILTER("table to look up the records from", [Column of the employee ID in the look up table] = [_THISROW].[Column of Employee ID of the current table]),

the list will automatically show the last 4 records without the need to creat a slice, once there are more than 4 records , you will see a "View 132" for example and you can see a list of all the records

you can nest an ORDERBY expressions as well as suggested by @Suvrutt_Gurjar 
TRUE) or press on the column header in the application to sort it manually assending or descending 


 

 

 

 

 

Wow, I really appreciate all your help guys. I owe you one. @Hussein_Osseily yes, very similar.

@Suvrutt_Gurjar  I got it to show the last 5 records now, thanks to your directions. 
This is the expression I use in the slice IN([Unique ID], TOP(ORDERBY(SELECT(TimeIn[Unique ID], [Person]=[Image]),[Time In],TRUE),5))
I can now see the last 5 records, but it show blanks canvas, is there any way I can show them as a list or table with info of who is the person, time scan in, and maybe tiny image of each person within the record? I attached the screenshot here for your reference.

Thank you so much๐Ÿ™ ๐Ÿ™ ๐Ÿ™
Scan In.PNG

Updates,

Got it to work now by changing the slice expression to  IN(ID], TOP(ORDERBY(SELECT(TimeIn[ID], [Person]=[Image]),[Time In],TRUE),5))

Since I have ID field for each person, and the Unique ID for each scanning, my bad.

That said, I cannot get it to view as a table, but a gallery type sliding left right. 

Thank you all again, guys.



Good to know it works.

@Vannak_Soth wrote:

That said, I cannot get it to view as a table, but a gallery type sliding left right. 

You could change the inline child table view from gallery to the table type.

How do I go about doing it? is it in the VC? and SHOW expression CONTEXT("ViewType")="Table"

You will have a system view titled as  "ChildTableName_Inline". Please make that view's setting as "table" from "gallery"

Suvrutt_Gurjar_0-1666148972244.png

 

Top Labels in this Space