Calculation examples

I’d like to see some awesome examples of calculation field here community site.

Best wishes from Finland!

/Sami

7 Likes

Progress bar calculation…

`<progress value="${@Progress/100}"/>`


ProgressBar 1

2 Likes

One more - “add a week to a date field”

date_fns.addWeeks(@Created on, 1)

WeekToDate

2 Likes

Great examples! And my big hello to Finland @samikuivalainen :blush:

Possibly helpful at this point for one or the other is our calculation introduction.
Calculation fields can range from simple additions to custom JavaScript code. Furthermore, the output rendering supports Markdown, HTML, and CSS. Check out more →

1 Like

Here is a favorite of mine for rendering headers.
(note: since we can use HTML this is less exciting)

4 Likes

Id like to use dates in calculation field, for example:

@startdate + @daystoadd = result of calculation.

what would be the best way to handle this?

Hi @samikuivalainen,

agree, that is indeed a common scenario. A code snipped like this turned out useful, utilizing the library date_fns to add the days to your date field value and calculate a new one:

The result inside the record will show the calculated date like this:

Screenshot 2023-04-23 at 09.42.26

Hope that helps. :innocent:

Cheers & happy Sunday
Tim

1 Like