dfox
Forms Fledgling

Calculated Value based on conditions and adding days to date

Jump to solution

Hi,

 

I am very new to Nintex and trying to create a calculated value on my form to display a date based on a condition that is listed in the column personnel type then take the implementation date and add days depending on the result of the column, but cannot get it to work.  The column is blank by default until user selects an option from the drop down.

 

Here is what I have so far, but when I try to view the form it comes up blank and won't display.  If I delete the calculated value field from the form then I am able to display the form so I know it is related to this calulated value not set up properly.

 

=PersonnelType=='Key',formatDate(dateAddDays(DateTimetoImplementChanges,120, 'MM/dd/yyyy'), formatDate(dateAddDays(DateTimetoImplementChanges,365, 'MM/dd/yyyy')

 

Thank you!

0 Kudos
Reply
3 Replies
SimonMuntz
Nintex Employee
Nintex Employee

Re: Calculated Value based on conditions and adding days to date

Jump to solution

Hi,

Unfortunately there is no formula validation in Nintex Classic or Responsive forms.

When the function is not valid it can cause the form to appear white and that is what is happening here.

The function should look like this:

If(equals(PersonnelType,"Key"),formatDate(dateAddDays(DateTimetoImplementChanges,120),"MM/dd/yyyy"),formatDate(dateAddDays(DateTimetoImplementChanges,365),"MM/dd/yyyy"))

This says that if PersonalType is equal to Key add 120 Days to DateTimetoImplementChanges and if its not equal it adds 360 days.

 

I have attached a sample form which demonstates this formula.

View solution in original post

Reply
dfox
Forms Fledgling

Re: Calculated Value based on conditions and adding days to date

Jump to solution
Thank you very much Simon for the correct function format and detailed explanation! Greatly appreciate it!!
0 Kudos
Reply
cblackl2000
Canvas Initiate

Re: Calculated Value based on conditions and adding days to date

Jump to solution
Thank you! This helped me with my New Responsive Form adding 14 days to my event date which I had been struggling with: formatDate(dateAdd("days",14,EventDate),"MM/DD/YYYY")
0 Kudos
Reply