Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

ConfiForms - Validate chosen datetime

Gordon Priebe November 30, 2025

Hi,

I created a form where people can pick a date and time and get an email with an ICS attachment. Already booked time slots are shown in CalendarView.

Everything works fine, only thing missing is the validation of the chosen date and time.

Only timeslots from e.g. the 8. to the 12. of December in the time from 9 -12 am and 1 - 5 pm should be valid choices.
How does the validation expression has to look like to achieve this?
Everything I tried so far failed.

And is it possible to set the CalendarView to a specific range of time, in that case the week where the slots can be booked?

Thanks for your help
Gordon

1 answer

1 accepted

2 votes
Answer accepted
Alex Medved _ConfiForms_
Community Champion
December 1, 2025

Hi @Gordon Priebe 

I will approach this with 2 Field Definition Rules, both set to "Validation rule" action

One will be with a "condition" parameter set to

date:<[date20251208 8:00] OR date:>[date20251212 17:00]

second

date.convertDate(HH):<9 OR date.convertDate(HH):>17 OR date.convertDate(HH):12

Example configuration in a page storage format for the reference and easy import

<ac:structured-macro ac:name="confiform" ac:schema-version="1" data-layout="default" ac:local-id="f1a555a7-7518-43d9-85fa-a990dbe18d20" ac:macro-id="3f5407e0f177dff5c321375b268244b44b2a0aa0c67bed5143adaabe1a8121f5"><ac:parameter ac:name="formName">form</ac:parameter><ac:rich-text-body><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" data-layout="default" ac:local-id="92bba700-bd29-4696-adfc-741c2e2143bf" ac:macro-id="61da1036-d34b-4c3a-8dab-511a945fa5d5"><ac:parameter ac:name="fieldName">field1</ac:parameter><ac:parameter ac:name="fieldLabel">field1</ac:parameter><ac:parameter ac:name="type">text</ac:parameter><ac:parameter ac:name="required">true</ac:parameter><ac:parameter ac:name="macroHash">44044919</ac:parameter></ac:structured-macro><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" data-layout="default" ac:local-id="8c784420-5212-4050-bc6e-cb48de236263" ac:macro-id="b4313b63-9dc7-4460-87e4-10d344934e2d"><ac:parameter ac:name="fieldName">date</ac:parameter><ac:parameter ac:name="fieldLabel">date</ac:parameter><ac:parameter ac:name="type">datetime</ac:parameter><ac:parameter ac:name="macroHash">-1421435954</ac:parameter></ac:structured-macro><ac:structured-macro ac:name="confiform-field-definition-rules" ac:schema-version="1" data-layout="default" ac:local-id="a4824e78-22da-48fc-9a46-7b066725b87c" ac:macro-id="51841389-bfb8-4c37-83af-d4517e90bdaf"><ac:parameter ac:name="condition">date:&lt;[date20251208 8:00] OR date:&gt;[date20251212 17:00]</ac:parameter><ac:parameter ac:name="fieldName">Only timeslots from e.g. the 8. to the 12. of December in the time from 9 -12 am and 1 - 5 pm should be valid choices.</ac:parameter><ac:parameter ac:name="action">Validation rule</ac:parameter><ac:parameter ac:name="actionFieldName">date</ac:parameter><ac:parameter ac:name="macroHash">2037468653</ac:parameter></ac:structured-macro><ac:structured-macro ac:name="confiform-field-definition-rules" ac:schema-version="1" data-layout="default" ac:local-id="efbfea1e-932e-444c-b3bb-8079ac0c65f2" ac:macro-id="f71526e4-797f-4f70-a6db-df606994e8b0"><ac:parameter ac:name="condition">date.convertDate(HH):&lt;9 OR date.convertDate(HH):&gt;17 OR date.convertDate(HH):12</ac:parameter><ac:parameter ac:name="fieldName">Only timeslots from e.g. the 8. to the 12. of December in the time from 9 -12 am and 1 - 5 pm should be valid choices.</ac:parameter><ac:parameter ac:name="action">Validation rule</ac:parameter><ac:parameter ac:name="actionFieldName">date</ac:parameter><ac:parameter ac:name="macroHash">-2036394417</ac:parameter></ac:structured-macro></ac:rich-text-body></ac:structured-macro><ac:structured-macro ac:name="confiform-entry-register" ac:schema-version="1" data-layout="default" ac:local-id="d811ee38-17ea-470f-82f7-d8a29664a769" ac:macro-id="5526087a4d81b811450abcabbe46d4a7e069cbbf2817668f20a819ca3c467107"><ac:parameter ac:name="redirectMode">View</ac:parameter><ac:parameter ac:name="formName">form</ac:parameter><ac:parameter ac:name="showMessageAs">Below the form</ac:parameter><ac:rich-text-body><p /></ac:rich-text-body></ac:structured-macro><ac:structured-macro ac:name="confiform-table" ac:schema-version="1" data-layout="default" ac:local-id="6a53e7e6-2c03-43af-ac98-1087d5af194a" ac:macro-id="78988eb997976af0683255fb5dddb3e515b8990d33265bb4c6fcf90bd7f578f3"><ac:parameter ac:name="formName">form</ac:parameter><ac:rich-text-body><p><ac:structured-macro ac:name="confiform-field" ac:schema-version="1" data-layout="default" ac:local-id="a9e76305-344b-47b7-b73e-324d1150414a" ac:macro-id="c986f7cb-313a-42e4-9953-205ad33b3e76"><ac:parameter ac:name="fieldName">field1</ac:parameter><ac:parameter ac:name="macroHash">-878774306</ac:parameter></ac:structured-macro></p><p><ac:structured-macro ac:name="confiform-field" ac:schema-version="1" ac:local-id="215bde42-7cc0-4a1c-bab3-bf5dfe8f8d5f" ac:macro-id="9f24f2db-8475-42d8-83de-8da2d75dd21d"><ac:parameter ac:name="fieldName">date</ac:parameter><ac:parameter ac:name="title">date</ac:parameter><ac:parameter ac:name="macroHash">607359967</ac:parameter></ac:structured-macro></p><p><ac:structured-macro ac:name="confiform-field" ac:schema-version="1" ac:local-id="8862042c-6e66-45ee-874f-7713e4d33ba3" ac:macro-id="4d657295-4dce-4eff-844e-3c7e40f2b3b2"><ac:parameter ac:name="fieldName">date.formatDate(HH)</ac:parameter><ac:parameter ac:name="title">date.formatDate(HH)</ac:parameter><ac:parameter ac:name="macroHash">-1935904879</ac:parameter></ac:structured-macro></p><p><ac:structured-macro ac:name="confiform-field" ac:schema-version="1" ac:local-id="49d52dfa-1dfc-4c2f-aa0f-c00900f894a1" ac:macro-id="e079b8e2-a318-4e13-a607-dd11a34e6133"><ac:parameter ac:name="fieldName">date.convertDate(HH)</ac:parameter><ac:parameter ac:name="title">date.convertDate(HH)</ac:parameter><ac:parameter ac:name="macroHash">1895092575</ac:parameter></ac:structured-macro></p></ac:rich-text-body></ac:structured-macro>

 

Alex 

Gordon Priebe December 1, 2025

Works :)

 

Thanks a lot.

Gordon Priebe December 2, 2025

Hi Alex,

I have a follow up.

People should only be able to pick a time in 15 minute slots, so eg. 10:00 / 10:15 / 10:30 / 10:45.

But datetime uses entry time when user just selects a date and not a time. So you can get e.g. a 8.12. 10:07.

Is there a way to prevent this?

If not, I would use two fields, one for date, one for time.
But in order to let the rest of the form work, I would need to combine this two values to a datetime. Is this possible?

Thanks again

Gordon

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events