How to Setup Time-based Conditional Logic for Gravity Forms the Easy Way
A point-and-click solution for creating conditional logic rules based on the current time. Works anywhere Gravity Forms conditional logic is supported (i.e. fields, confirmations, notifications, etc).
This article requires the Gravity Forms Conditional Logic Dates perk.
Buy Gravity Perks to get this perk plus 46 other premium Gravity Forms plugins!
This tutorial will demonstrate how to show/hide fields via Gravity Forms’ conditional logic based on the current time. This functionality can be used anywhere conditional logic is available and is made available by the GP Conditional Logic Dates plugin.
Here are just a few examples of how this could be useful:
- Time-sensitive Submissions
Allow a Gravity Form to only be submitted during a certain time of day. - Time-dependent Confirmations & Notifications
Display different confirmation messages or send specific notifications depending on the time of day the form is submitted. - Time-responsive Fields
Show or hide fields on your form depending on the time of day.
Ready to get started? Here we go!
Steps
- Install & activate GP Conditional Logic Dates.
- Add a time-based conditional logic rule.
1. Install & activate GP Conditional Logic Dates.
Install and activate GP Conditional Logic Dates.
2. Add a time-based conditional logic rule.
- Open your form in the Form Editor.
- Select the field for which you want to configure a time-based conditional logic rule.
- Click the “Advanced” tab.
- Click the “Enable Conditional Logic” setting.
- Select “Δ Current Time” from the first drop down which contains your form fields.
- Enter the time in the required format.
Time-based conditional logic must be entered in the 12-hour format.
That’s it! Your field will now show or hide depending on the specified time-based rule.
Hi Samuel,
Thanks a lot !!! works like a charm and do the job prefectly !!! :-)
Many thanks again, Mike
Thanks for letting us know Mike! Glad it works for you.
Hi Guys,
Unable to make this feature works: {today:-90 days}
I would like a field shown only if the date put by the user is no more than 90 days before the today date.
If I set the conditional logic like this: show if all date, is, {today:-90 days}
It’s just never showing the field. With an only few days before today but same with 91 days before…
Any idea? Do i’m doing something wrong ?
Thanks and best regards, Mike
Hi Mike,
Instead of using the “is” operator, can you try using Greater Than? So you should have something like Today’s date greater than {today:-90 days}.
I hope this helps.
Best,
With the UTC timezone snippet mentioned in an earlier comment here, is there any way to specify another timezone? eg. UTC+8 ?
Hi Scott,
By default, the Conditional logic will use the time zone set for the Website on the Setting pages, so if you want to use a different TimeZone, you can set it there. However, if you want to adjust the Timezone to UTC +8 regardless of the default timezone set, that snippet will have to be customized further. If you have an active Gravity Perks Pro License you can get in touch with us via our support form, so we can assist you further.
Best,
Does this conditional logic work as a before this date? For instance, the form cannot be submitted if the date picker date selected is on or before 1/1/2015?
Hi Ellen,
Yes, you should be able to show/hide the Submit button of the form based on a date on the form using Conditional Logic Dates Perk/
Cheers,
Thanks for the quick response. Does it also work with a “Today less 4 years” scenario? We need to have the form require the date be less than 4 years ago.
Hi Ellen,
From what I understand It should work for any date conditions!
Cheers,
We want to set up a simple responder dependant on the “local” time of day, ie. 5:00pm GMT, but our visitors may be in different time zones. Is the time set by the client side or the server? is there a way to set the time to particular timezone?
Hi Cel,
GP Conditional Logic Dates uses the user’s local time based on their user profile, but if you’d prefer to set it based on UTC, we have a snippet for that. It automatically adjusts the user’s local time to UTC and then evaluates based on that.
I hope this helps.
Best,
I need to have users fill out a form stating someone’s birthday. If the birthday is too soon, I do not want them to be able to complete the form.
I need to edit videos and a minimum of 4 days is required. They need to INVITE friends/family to upload videos which also requires at least 3 days. SO…….
When they answer the question of WHAT DATE the recipient’s BIRTHDAY is, I want to have the form automatically process the VIDEO UPLOAD DATE = (which is 4 days BEFORE the birthday) –
and also have a date displayed for the minimum 3 days to INVITE friends/family to UPLOAD videos. Can I do this with the Gravity Forms Conditional Logic Dates Add-on???
Hello, We are caterers who offer ordering up until Thursday at 5pm for pickup on Sunday. We want to limit the available pickup dates based on that Thursday at 5pm cut off. Meaning, today is Tuesday, 8/4/2020. People can order food this week until Thursday, 8/4/2020 until 5pm for pick up on Sunday, 8/9/2020. We want to offer pickup times of Sunday in the future but no longer offer 8/9/2020 as a pick up time after Thursday at 5pm. Is that possible? (Did I ask the question so it makes sense?) Thank you! – Perry SIOD
Hi Perry,
This is quite an interesting use case, which I would guess should be possible with a combination of our GP Conditional Logic Date and GP Limit Dates Perks. If you’re a Gravity Perk Customer, you can send us a message via our support form with an attachment of the form export so we can get a better picture of your setup and assist you further.
Best,
Hi,
Does it work for time frames? For example for 9-5 to enable one condition and >5 and <9 to enable a different one.
Cheers
Hi Alex, yup, here’s an example of showing a field between 9am and 5pm (https://gwiz.io/2NRCVQe) and here’s an example of showing a field before and after hours (https://gwiz.io/2OjXuDS).
I tried installing this plugin Gravity Forms 2.3.2 and WordPress 4.9.6 but it doesn’t work.
Oh never mind I figured this out. I didn’t “activate” the perk.
Happy to hear you were able to get this working. :)
Can this be used to send the form to different people based on time of day? For instance? – Between 9-5 form is emailed to Bob. – After 5 and before 9, email is sent to Sally.
Would this work?
How to to a age check for example 18 years and older?
Our best solution is the GP Date Time Calculator plugin that is available as an early access perk with our Gravity Perks plugin suite. It provides an “:age” merge tag so you can just put it in your formula like so:
{Date of Birth:2:age}
. If you’d like to try it out pick up a copy of Gravity Perks and drop us a line via support.Essentially trying to get a field to display on a weekday BEFORE and AFTER business hours and not during normal business hours. I’ve successfully gotten my {monday}-{friday} types of tags working from your conditional date plugin. I’m just running into a roadblock trying to get this logic to work out someway.
Here’s What I have for the field I’m trying to hide or display:
[Show] this field if [All] of the following match: Current Time is [Less Than] 07:00am Current Time is [Greater Than] 04:00pm Today [isnot] {Saturday} Today [isnot] {Saturday}
Any help on how to get this done would be much appreciated!
I am using “Beta version” of GP Conditional Logic Dates but i did not get “current time” option in that. Also its not working with week names like i want to open my salon from Monday to Friday so don’t want to book any entry for Saturday and Sunday
Hi Baljeet, please submit a support request and we’ll be happy to help.