Solved

Calculated Value based on conditions and adding days to date

  • 11 September 2019
  • 3 replies
  • 151 views

Badge +3

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!

icon

Best answer by SimonMuntz 12 September 2019, 01:51

View original

3 replies

Userlevel 6
Badge +22

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.

Badge +3
Thank you very much Simon for the correct function format and detailed explanation! Greatly appreciate it!!
Badge +4
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")

Reply