How to automatically set a Due Date based on the Issue Date
If the due dates for the payments or invoices you issue to your clients follow a consistent pattern, meaning they are based on N days from the issue date, there's an easier alternative to manually setting the due date each time. You can convert the Date field into a Formula field. In the formula, we'll add N days to the issue date of the payment or invoice, giving us the desired due date automatically.
In this article, we’ll focus on the due date of invoices or payments as a common example, but this method can be applied to any situation where you need to automatically calculate a date based on another.
Let’s look at an example:
We’ll use the dateAdd()
function to add N days to the issue date. In this example, we’ll add 10 days. However, you can customize this by adding the number of days or any other time unit you need, such as weeks, months, or years.
Watch the video below to see the steps in action:
The dateAdd()
function adds time to a date. The unit argument can be one of the following: "years," "quarters," "months," "weeks," "days," "hours," or "minutes."
prop("Issue Date").dateAdd(10, "days")
💡 Pro Tip:
The number of days to add doesn’t have to be entered manually. It can also be based on a number configured in another field within the same database or even from a related database. This flexibility allows for dynamic and context-sensitive due dates.
Example:
prop("Issue Date").dateAdd(prop("Days to Add"), "days")