You are viewing limited content. For full access, please sign in.

Question

Question

Forms - Date calculation based on another drop down field's value 2

asked on November 23, 2016

How can I get LF Forms to take a date submitted, add a number value from another drop down field and calculate a date by adding that many days?  I'm almost there, I think.  Here's what I've done so far:

This is on the Application Form:

It is a choice the applicant makes for how long a duration they are applying for.

Then:

This is on the Approver's Form: 

I want this calculation to take the starting date from the application form, then add (2, or 14, or 61) days based on the value of the choice made.  The result would be filled in as an Expiry Date on the Approved Permit that goes back to the applicant.  This would be a read only field, and if the Approver wanted to shorten the duration, he would change the field choice for the duration before approving.

So, what should this calculation actually look like?   

0 0

Answer

SELECTED ANSWER
replied on November 25, 2016

Hi Connie,

You need to make sure that the same fields (variables) are used on the application and approval forms.

One way to achieve this is to first make sure the formula is working on the application form. Then make a copy of that form to use as the approval form and then modify that approval form as necessary.

Another way to do this is if you are building the approval form from scratch, to use the same variables that exist on the application form instead of using new fields.

Regards

1 0

Replies

replied on November 23, 2016

Using the variable names from your example, you can use a formula like

=Requested_Permit_Start_Date+IF(Requested_Permit_Duration_1="",0,Requested_Permit_Duration_1)

See this video for an example.

3 0
replied on November 25, 2016

Thanks, Alexander!  Still testing, but I'm pretty sure this has worked.  Unfortunately, my Duration_1 field is not bringing in the input from the application form to the approval form now, so my test results are calculating based on a zero input.

I have rebuilt the Duration field on the approval form 3 times now and can't figure out why it won't pull in the input from the application.  Any ideas?

0 0
SELECTED ANSWER
replied on November 25, 2016

Hi Connie,

You need to make sure that the same fields (variables) are used on the application and approval forms.

One way to achieve this is to first make sure the formula is working on the application form. Then make a copy of that form to use as the approval form and then modify that approval form as necessary.

Another way to do this is if you are building the approval form from scratch, to use the same variables that exist on the application form instead of using new fields.

Regards

1 0
replied on November 30, 2016

Awesome!  I had previously tried rebuilding numerous times to get the right variable, but this time I completely deleted the duration field out of both the application and approval forms and every reference to it (all variables).  Then rebuilt it and added it back into both forms and the programming for the Expiry Date.  Everything worked perfectly!  Thanks so much!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.