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

Question

Question

Forms Process Diagram - Inclusive Gateway - Outflow

asked on August 15, 2024

I am new to Laserfiche Forms.  My outflow path I am trying to use the DATEDIF date function to determine if a date entered is within one year from the current date.  Here is what I have

DATEDIF(/dataset/Ever_Used_Drugs_Yes/Drugs_Last_Usage_Date_1,/dataset/CurrentDate,"Y") < 1

Can a date function be used in an outflow path and if so, do I have this set up correctly?

0 0

Replies

replied on August 15, 2024

It is my understanding that the conditional paths don't work like that.  You essentially have to create the function within the form and use the result as your condition.  I just responded to a similar post that should help you.  Date Condition on a Form - Laserfiche Answers

1 0
replied on August 15, 2024

Thanks for your reply.  I tried what you suggested and I am getting a syntax error:

=IF(Ever_Used_Drugs_Yes.Type_Of_Drug="Marijuana" AND DATEDIF(Ever_Used_Drugs_Yes.Drugs_Last_Usage_Date_1,CurrentDate,"Y")<1,"Yes","No")

Any ideas?

0 0
replied on August 15, 2024

AND is a function not an operator so you can't use it that way. If you check the documentation linked in my other post it lists the functions and their syntax; it uses OpenFormula standards, so it is fairly similar to Excel/Google Docs.

The syntax is AND(condition1, condition2) and it returns a true/false value.

If differs in that it outputs a value based on a condition like

IF(condition, trueValue, falseValue)

Also, I it looks like you may be using variables that are in a table/collection which also changes the functions because table/collection variables contain a list/array of values rather than a single value (even if there's not multiple rows).

If you can provide a little more context about those source value fields, it would help narrow down what else you might need to change.

If this new calculation field is meant to be used in your gateway conditions, you also usually wouldn't want that particular field inside of a table/collection to ensure your calculated field is single-valued.

0 0
replied on August 16, 2024

Thank you for your reply and thank you for your help.

I created a field named Marijuana_Used_One_Year_1.  It is a single line field that is hidden on the form.  In the calculation field, I added the code that is giving the syntax error.  I did want to use the Marijuana_Used_One_Year_1 my gateway condition - /dataset/Marijuana_Used_One_Year_1="Yes"

Ever_Used_Drugs_Yes is a table.  Drugs_Last_Usage_Date_1 is a drop down field in the table.  CurrentDate is a single line field that is hidden on the form.

I work for a law enforcement agency.  We are trying to use Laserfiche Forms for our application process.  If an applicant uses marijuana within one year then the applicant is automatically disqualified.

0 0
replied on August 16, 2024

I'm trying to recreate your form and for the calculation of the number of days, in your drop down for Drugs_Last_Usage_Date_1, are you using a list of dates or a length of time?

0 0
replied on August 16, 2024

Drugs_Last_Usage_Date_1 is not a drop down.  It is a single date field where a user can enter a date.

0 0
replied on August 15, 2024

The Calculations/Functions are only available on the forms. One option is to use your function in a hidden field on the form, then you can use that variable in the gateway path condition.

Using Conditional Expressions (laserfiche.com)

Formulas in Laserfiche Forms

0 0
replied on August 16, 2024

I read your replies and this is what I came up with.

=AND(INDEX(Ever_Used_Drugs_Yes.Type_Of_Drug,ROW())="Marijuana",DATEDIF(INDEX(Ever_Used_Drugs_Yes.Drugs_Last_Usage_Date_1,ROW()),CurrentDate,"Y")<1,"Yes","No")

Now I am getting a message: This field contains a calculation error. References: Type Of Offense, Date Of Incident, Date Time.

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

Sign in to reply to this post.