Date/Time of entry when User signs in

Hey Bubble community.

So I created a page that shows a list of users signed in on a business page. I want it to show the date and time when the user checks in. How do I go about doing that? Your help is appreciated! I can’t seem to figure it out.

Add a date field called “Last logged in date” to the user object.

Add to the “log the user in” workflow a “modify the user” action that sets the current date to the above “last logged in date” field…

Hi Cmarchan. Thank you for your response. I believe I wasn’t being super clear. Apologies!

So what I did is I created a custom data type called “Business” which act as a business page.

Let’s say a user created a business page. So now when OTHER USERS visits that business page - they can check in in to the business. Which makes that visitor user be put on a list of “businessUSERS”.

What I am trying to do is for the Business Page Creator/User to view a list of checked in visitors that displays the Visitor Users information + the date and time of when the Visitor User checked in the business page. How do I show the date and time for when the user checked in to the business page?

I hope that makes sense!! Sorry for the confusion. Looking forward to hear back from you.

Hello,

Create a data type called “visit “ with a date field of type date, a user who visited field of type user, and a page field of option set type page (create the necessary pages within this option set)

On that page create a workflow on page load with an action to create a thing … a visit … and load up all the respective data … the date, the user who visited, and the page option type.

This way you can count the number of visits per user that a page receives

1 Like

I’d create a datatype called “Visit” too like @cmarchan says.

Data fields:-

  1. Date = Checked In
  2. Date = Checked Out
  3. User = Visitor
  4. Business Page = Business Page
  5. User = Business Page Owner

Then a Check In button on the page that allows the user to check in or if you want it when they visit the page, with a workflow "When Checked In button is clicked, create a new thing > Visit > then add fields above Checked In = Current Time/Date, Visitor = Current User, Business Page = This page, Business Page Owner = This Page’s Creator

Then create a Repeating Group on the page as Visit > Do a Search for Visits with the constraint Business Page = This business page. In your Repeating Group have like your screenshot. Under Name: Current Cells Vistor’s Profile Picture and Current Cells Visitor’s Name. Under Email: Current Cells Visitor’s Email. Under TOE: Current Cells Checked In.

^ The above may be slightly off as I’m half asleep and haven’t done it myself but you get the jist.

1 Like

Thank you Tzuork. I got it working! Question though. So now when the user signs out of that business page. How do I get the list to show the TIME OF ENTRY and TIME OF EXIT?

Right now, after I mirrored the “checkin button” workflow you showed me and did “checked out” instead of “checked in”, I was able to display the TIME OF EXIT data on the list. Would you know how to show both TIME OF ENTRY and TIME OF EXIT?

Also, is it possible to display “hours worked” data on the list? Like for bubble to calculate the hours length of when the User Signed In - to when the User Signed Out of the business page.

Or If you have a more efficient way of doing this. I’d love to know your suggestions. Thank you in advanced @tzuork

Thank you cmarchan! I followed you and Tzuorks advice

We can achieve this by doing make changes to thing. Lookup for the latest sign in time and update the logout time against the same.
But question is what if the user do not log out, instead closes the window?
We have to set auto log off for 10 or 15 min.

Hello buddy,

You’re very welcome.

You need another data field in that data type, call it Time of Exit and put it as a date field. Create a “Check Out” button, and then do "When this ‘Check Out’ button is clicked, make a change to thing > Visit > then do field Time of Exit = Current Date/Time. Copy the Repeating Group above (Employees Signed In) and paste it below and call it (Employee Signed Out) like you have in the screenshot. Now change “Time of Entry = Current Cells Checked In” to “Time of Exit = Current Cells Checked Out” in your current cell and change the column name to “Time of Exit” from “Time of Entry”.

You’re doing well though, so well done.

Regarding hours worked, when your user clicks the “Check Out” button and you make a change to Visit, add another field called “Hours Worked” and do “Hours Worked = Checked In - Checked Out: formatted as hours” and that’ll do what you want. Make sure to have the dash in between the Checked In and Checked Out. May have to switch those around if it shows as a minus. You can also just add a text box below “Hours Worked” in your repeating group and do “Current Cells’ Checked In - Current Cells’ Checked Out: formatted as hours” instead if you don’t want to save the hours worked in your database.

Hope that helps.

I don’t know what’s wrong but I made a check out/ sign out button and when the button is clicked. And step 1 is “make changes to thing” It’s not letting me put “Visit” as things to change. On “things to change” I can only see “current User”, “Current Page Business”, and “Do a search for”.

I can only see “Visit” when I do “Do a search for” and then type as “Visit”. I must have messed up somewhere. May you help me on this? I will shoot you a message. Sorry for the hassle @tzuork

This topic was automatically closed after 70 days. New replies are no longer allowed.