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

Question

Question

Compare date fields using Field Rules

asked on April 10, 2019

I have a form used to drop a class.  The form performs a lookup to return current term information.  The information returned by the lookup includes the last day of the term to drop a class.  If Today is after the Last Day to Drop a Class then the student needs to be presented with a message informing them of that and given a different choice. 

In this test form, today is April 10th.  The last day to drop a class was April 5th.  So the usual class drop fields should be hidden and some new alternatives should be shown.

It is a simple Show/Hide using Field Rules...except I don't know of a way to compare a date field with a date field using Field Rules.  I can do this with javascript but I thought it should be something I could do much easier with Field Rules. 

The only allowed comparison with a date field under Field Rules is to compare it to a literal date, either entered or chosen with the date picker.

Am I missing something or is this by design?  And if it is by design, please consider this an enhancement request.  

0 0

Answer

SELECTED ANSWER
replied on April 10, 2019

You can create a hidden field with a formula that compares the current date with the drop date. Something like =IF(current date > drop date, "Late", "OK")

Then you can set a field rule that looks at the hidden field and if it's value = Late, hide all the fields and show a message. Otherwise allow the form to be submitted. 

1 0

Replies

replied on April 10, 2019

Thanks for the quick reply Jared!

I was hoping there would be something more elegant.  I'm sure there is a good reason why we can't perform a comparison like that.  Do you know of the reason?

0 0
replied on April 10, 2019

It's a feature request that we haven't prioritized highly because of the workaround. We are looking into enhancing field rules for Forms 10.5, but we are looking more at things that are currently impossible (like building complex conditions with ANDs + ORs, making fields required using fields rules, and using the stage/step as a condition)

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

Sign in to reply to this post.