How to get this week's data from a database?

Hi there! I would like to be able to get data of only this week from the database.

I have a database that consists of " workedHours " (field key). It is a number that value is of worked hours. I would want to filter the database so that it would show the total number of worked hours by using a TEXT Element. I think it needs to get this week’s info , then it would do a loop to add these workedhours items and set their total to a text element .

I also must note that the database is updated everyday. So workedHours are added everyday. They might have 0 or 20 or 30 total hours depending on their worked hours. And then when it’s Monday, it backs to total of 0 worked hours since it’s a new week.

I tried searching here but found nothing. I tried looking at the API documentation as well but unfortunately, those were of different use.

Please help. Thank you and stay safe.

Hi.

You can use data API’s aggregations to filter and calculate total by following the guidelines here: Corvid: Working with Aggregations in the Data API

Also, you may have to create time helper functions as shown in step 14 of this tutorial.

Finally, you can schedule a recurring job to make your totals 0 at a given time on Mondays as instructed here: Corvid: Scheduling Recurring Jobs

Good luck!

Fortunately, I got mine to work. :two_hearts: