Conitional formating

I have a element on my page that is calculating the days between 2 dates.

Example would be 16/03/2023 - current date = 6 days.

Now from my excel experience i would normally conditional format a cell to return a value depending on how many days diff there is between the 2 dates.

Example: if the days are less than 15 then the cell would show Expiring Soon.

Im looking to try recreate the same function in Bubble where in a separate textbox or whatever it would display Expired or Not Expired based on another box’s calculation.

Also im very new to the Bubble system

Hi there, @david8547… what type of element is calculating the days between the two dates? If it is an input element, you will be able to reference that element’s value in a conditional on the text element where you want to display the expiration text. If it is a text element, you won’t be able to reference its value.

The above being said, add a text element to the page. Go to the Conditional tab of that element and add a condition. Define a condition that either references the other element’s value or just calculate the difference between the two dates directly in the condition. Here is an example of the former.

condition

Finally, as shown in the screenshot, define the text you want to display when the condition is true, and you should be good to go.

Hope this helps.

Best…
Mike

Wow thanks for such a quick response :slight_smile:

im using a textbox to do the calculation ( Date 1’s value - Current date/time:format as days)

Fantastic help i managed to get it working for the most part.

Let me explain abit more.
Im trying to track the expiry dates of documents which have 3 diff values

Documents with more than 30days left need to show “Good to go”
Documents with less than 30days but more than 1 days need to show “Expiring soon”
Documents with 0 or less days need to show “Expired”

Ill screen shot what my page actually looks like and also my excel example
Page example

Try conditions that look something like this.

Oh, and it might not be necessary here, but it probably couldn’t hurt to go to your Settings >> Versions tab and enable the experimental parentheses feature.

Mike your the best thanks so much :slight_smile:

bellow are my results:

resultpage

1 Like

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