Date & time - sorting and conditionals

Hey there,

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:

  1. 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.

  2. 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.

Thanks,
Barty

  1. when you search or filter the shipments, use the creation date with " Extract from date" option: extract from date the month and the year

1 Like

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:

  1. shipment date ≥ current date/time; rounded down to month
  2. 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).

1 Like

Thank you so much!

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.

Maybe you could also help me out with setting a postal code validator?
https://forum.bubble.io/t/postal-code-validation/140715

I want to validate if the recipient is in the service zone and I have a list of postal codes, that are in service - more details in the linked thread.

Once again - thank you so much!

1 Like

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