I’m repeating a web app in Bubble allowing users to send and track parcels (courier services).
Shipments database contains a date of creation, price, addresses etc. for rach parcel.
I’m struggling to set up the following:
Counter of total shipments cost for current and previous month.
I’d like to display to the users the current total cost of their shipments - this is set up.
I’m just struggling to set up the counter to March only let’s say.
Cost-free or paid cancelation.
Each user has ability to cancel their shipments.
If the shipment is cancelled till 14:00 (2:00 PM) I want the cancelation to be cost free, while we want to count the amount for shipments canceled after a set time of the day.
Everything just relates to setting some conditionals or anything including the data - I’m just not sure how to set it up.
Let’s say I want to have a checkbox “Current month” and once it’s clicked, I want the Repeating Group to just show shipments for the current month - how to do this?
Or if want to have a checkbox “Non-delivered only”, how to make Repeating Group show just the shipments in status other, than Delivered?
Let’s say I want to have a checkbox “Current month” and once it’s clicked, I want the Repeating Group to just show shipments for the current month - how to do this?
You need to add constraints to your search on the data source of the RG.
To show results for the current month (i.e. when the Current Month checkbox is ticked) use 2 constraints:
shipment date ≥ current date/time; rounded down to month
shipment date < current date/time: rounded down to month; +1 month
Or if want to have a checkbox “Non-delivered only”, how to make Repeating Group show just the shipments in status other, than Delivered?
For this just add a constraint such as deliver status <> Delivered (or whatever fields and values you use).
I’ve managed to set up a checkbox for non-delivered ones.
Still struggling with the date thing, but I’ve realised, that shipment.date was set as “text” instead of “date” in my database, so I guess that’ the problem.
Will let you know once the issue with database is fixed.