Using Rules for fields

Nicole Uschman February 3, 2025

I created a form with a radio group field  and a checkbox field. And I have a date intervall field.

The radio group has this options:

1=desk1

2=desk2

3=desk3

4=desk4

5=desk5

I want tot do as follows: No double booking for the options desk1-desk5. If the checkbox is checked the booking for the options 1-5 is no longer possible. If there a desks already booked you cannot check the checkbox. Checking the Checkbox= all desks are booked.

I can`t figure out the rule that would makes this work properly :-(

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.
February 3, 2025

Hi @Nicole Uschman 

Should the validation logic also take into an account the datetime interval the desk is “taken”?

Alex

Nicole Uschman February 3, 2025

That would be perfect

 

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.
February 5, 2025

Hi @Nicole Uschman 

Not very trivial, as it includes the check for date intervals overlapping, but here it is

A video

And the storage format for the reference

<ac:structured-macro ac:name="confiform-table" ac:schema-version="1" ac:macro-id="093bad75-f2de-4f00-9e28-af50975b1124"><ac:parameter ac:name="formName">form</ac:parameter><ac:rich-text-body><p><br /></p></ac:rich-text-body></ac:structured-macro><p><br /></p><ac:structured-macro ac:name="confiform" ac:schema-version="1" ac:macro-id="93936d60-9de6-4e46-969a-625f9391d152"><ac:parameter ac:name="hideAdminUI">true</ac:parameter><ac:parameter ac:name="formName">form</ac:parameter><ac:rich-text-body><p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="51b5deba-67c9-4fd6-b022-f6bddc911fc8"><ac:parameter ac:name="fieldName">dti</ac:parameter><ac:parameter ac:name="fieldLabel">dti</ac:parameter><ac:parameter ac:name="type">datetimeinterval</ac:parameter></ac:structured-macro></p><p><ac:structured-macro ac:name="confiform-field-definition" ac:schema-version="1" ac:macro-id="466b50d9-d847-4136-9e7b-6fcc3a821793"><ac:parameter ac:name="fieldName">desk</ac:parameter><ac:parameter ac:name="fieldLabel">desk</ac:parameter><ac:parameter ac:name="values">false[1=desk1|2=desk2|3=desk3|4=desk4|5=desk5|]</ac:parameter><ac:parameter ac:name="type">radio_group</ac:parameter></ac:structured-macro></p><p><br /></p><p><ac:structured-macro ac:name="confiform-field-definition-rules" ac:schema-version="1" ac:macro-id="9441bdbb-3f66-4ab1-9e9d-295e411eceef"><ac:parameter ac:name="condition">!dti:[empty]</ac:parameter><ac:parameter ac:name="fieldName">desk</ac:parameter><ac:parameter ac:name="values">dti.queryCount(form:@self;desk:[entry._func.asEntryRef(entry.desk)] AND dti.startDate:&lt;[entry.dti.endDate] AND dti.endDate:&gt;[entry.dti.startDate]):0</ac:parameter><ac:parameter ac:name="action">Apply Filter on a field</ac:parameter><ac:parameter ac:name="actionFieldName">dti</ac:parameter><ac:parameter ac:name="values3">desk:[entry._func.asEntryRef(entry.desk)] AND dti.startDate:&gt;[entry.dti.endDate] AND dti.endDate:&lt;[entry.dti.startDate]</ac:parameter></ac:structured-macro></p><p><br /></p></ac:rich-text-body></ac:structured-macro><ac:structured-macro ac:name="confiform-entry-register" ac:schema-version="1" ac:macro-id="0c612497-0385-4313-b73c-7ba78c4c5ba7"><ac:parameter ac:name="hideMetadata">true</ac:parameter><ac:parameter ac:name="formName">form</ac:parameter><ac:parameter ac:name="type">Embedded</ac:parameter><ac:rich-text-body><p><br /></p></ac:rich-text-body></ac:structured-macro>

Hope it helps

Alex

Nicole Uschman February 5, 2025

Great. That works just fine. But one more thing: There should be another choice for the radio group for booking all of the desks(= the room completely) And if this option is already choosen no desk can be booked at all for the same intervall. How can I implement this?

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events