Is there a way to limit the time slots available for selection on ConfiForm Calendar View?

Jojo
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 9, 2024

I'm trying to create a sign up where users can sign up for a 20 minute interview slot. The interviews are weekly on Monday from 9-10 AM and Wednesday from 1-2 PM. 

I'm hoping to create a validation where it only allows users to select times from those slots. As a bonus, it would also only show those time slots available in the date/time selector on the form. 

I'm thinking to use a Confiform Rule Definition, but am not sure how to isolate the time data from the date-time field. 

1 answer

0 votes
Alex Medved _ConfiForms_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 10, 2024

Hi

At the moment you cannot disable selection in the CalendarView or in the date picker, but you can certainly validate the input

I would go with 2 validation rules with conditions as follows (my field name to capture the datetime is called "dt")

(!dt.formatDate(E):Mon AND !dt.formatDate(E):Wed)

and

((dt.formatDate(E):Mon) AND (dt.formatDate(H):<9 OR dt.formatDate(H):>10)) OR ((dt.formatDate(E):Wed) AND (dt.formatDate(H):<13 OR dt.formatDate(H):>14))

 

Screenshot 2024-12-10 at 17.53.00.png

Full configuration of a demo form as a page storage format is below

<ac:structured-macro ac:name="confiform" ac:schema-version="1" ac:macro-id="9a16bc0f-a0e9-4e9e-bb1a-c741407ca2eb"><ac:parameter ac:name="formName">form</ac:parameter><ac:rich-text-body><ac:structured-macro ac:name="confiform-entry-register" ac:schema-version="1" ac:macro-id="7555815c-baa1-471b-8bd3-144682bf1925"><ac:parameter ac:name="type">Embedded</ac:parameter><ac:rich-text-body><p><br /></p></ac:rich-text-body></ac:structured-macro><p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="b184f842-20d8-47e2-812d-744d9bb681f5"><ac:parameter ac:name="fieldName">dt</ac:parameter><ac:parameter ac:name="fieldLabel">dt</ac:parameter><ac:parameter ac:name="values">20</ac:parameter><ac:parameter ac:name="type">datetime</ac:parameter></ac:structured-macro></p><p><ac:structured-macro ac:name="confiform-field-definition-rules" ac:schema-version="1" ac:macro-id="6a11334b-6dc3-467f-b1c6-2d466dc50458"><ac:parameter ac:name="condition">(!dt.formatDate(E):Mon AND !dt.formatDate(E):Wed)</ac:parameter><ac:parameter ac:name="fieldName">The interviews are weekly on Monday from 9-10 AM and Wednesday from 1-2 PM.</ac:parameter><ac:parameter ac:name="action">Validation rule</ac:parameter><ac:parameter ac:name="actionFieldName">dt</ac:parameter></ac:structured-macro></p><pre><br /></pre><p><ac:structured-macro ac:name="confiform-field-definition-rules" ac:schema-version="1" ac:macro-id="4852458e-9ab9-413a-8241-1412f6c2d4e8"><ac:parameter ac:name="condition">((dt.formatDate(E):Mon) AND (dt.formatDate(H):&lt;9 OR dt.formatDate(H):&gt;10)) OR ((dt.formatDate(E):Wed) AND (dt.formatDate(H):&lt;13 OR dt.formatDate(H):&gt;14))</ac:parameter><ac:parameter ac:name="fieldName">The interviews are weekly on Monday from 9-10 AM and Wednesday from 1-2 PM.</ac:parameter><ac:parameter ac:name="action">Validation rule</ac:parameter><ac:parameter ac:name="actionFieldName">dt</ac:parameter></ac:structured-macro></p><p><br /></p></ac:rich-text-body></ac:structured-macro><ac:structured-macro ac:name="confiform-table" ac:schema-version="1" ac:macro-id="21934f2b-a290-4bf9-a0b1-449d7a9fcca4"><ac:parameter ac:name="formName">form</ac:parameter><ac:rich-text-body><p><ac:structured-macro ac:name="confiform-field" ac:schema-version="1" ac:macro-id="2f5340bf-cd8d-4daa-95ff-126bf63e3acb"><ac:parameter ac:name="fieldName">dt</ac:parameter></ac:structured-macro></p><p><ac:structured-macro ac:name="confiform-field" ac:schema-version="1" ac:macro-id="23685eaf-3147-4bbe-8638-e16e911a76d3"><ac:parameter ac:name="overrideLabel">day of week</ac:parameter><ac:parameter ac:name="fieldName">dt.formatDate(E)</ac:parameter></ac:structured-macro></p><p><ac:structured-macro ac:name="confiform-field" ac:schema-version="1" ac:macro-id="38bc01d8-20f7-4d32-bfb6-7aca4ac7f494"><ac:parameter ac:name="overrideLabel">hour</ac:parameter><ac:parameter ac:name="fieldName">dt.formatDate(H)</ac:parameter></ac:structured-macro></p></ac:rich-text-body></ac:structured-macro><p><br /></p>

 

Alex

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events