Filtering users list of timecards and showing icon conditionally on calendar day

I struggle filtering users list of timecards and showing them conditionally on calendar.
I’m not sure what is wrong with this expression? Any tips?

Filtering users timecard


Searching timecards (this won’t work in a long run)

Happy to help. In plain English, what logic are you trying to create?

Also, what does “Current User’s Timecard’s Date” refer to?

Thanks for your help!

I would like to show red clock icon on a calendar day (one day is reparative group’s current cell)

So if any of current user’s list of timecards records date contains current calendar date cells icon colour is red or visible.

When users submits a timecard it will save a date to a own field. On a calendar I just want to show if the timecard has been submitted or not for current user on that day.

I’m using this calendar

Got it. Thanks for the context. Here’s one way that should enable you to do that:

  • When: Do a Search for Timecards (where User = Current User)'s Date: formatted as 8/17/18 contains Current cell’s date: formatted as 8/17/18, Set Icon color = #FF4444 and Element Visible is yes.

Thanks for this. I just wonder if it’s possible to do the search inside current user’s list of timecards.
Every time timecard is added it’s beinf added to user’s list of timecards. Otherwise it will search everybody’s timecards and it will be big search after while.

Search is really fast. Loading the data to the UI is slow. So, as long as the search is done in the database (and not needing to return a lot of data to the UI) it should be very fast.

The one risk for performance with this is adding the “:formatted as…” parameter to each side of the equation. I don’t know for sure that Bubble calculate’s that in the database. I assume so, but there’s a material chance they don’t.

So, if that approach is slow, then easiest solution may be to simply store the formatted as version of text as a separate field in the table, and then reference that directly.

I was just calculating that with with many employees the amount of timecards goes high really fast. Was there a limitation to search up to 50.000records?

You can search a single table very quickly even if it’s much larger. Databases are very fast and they’re especially good at searching a single table.

In a database, it’d be slower when you need to join two+ tables or sort a long list of entries. With 50k entries, these types of operations will slow you down noticeably.

Those operations are still much, much faster than loading the data back to the client though.

Thanks for clarifying how search works and what comes to performance.

I have moved on with my app and I have been able to add a lot o new functionalities. I just wonder how should I calculate total hours?

I have repeating group that calculates total hours from clock in and clock out on a row… but how can I calculate total hours? I haven’t been able to figure this out.

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