# Unique composite fields

**URL:** <https://forums.knack.com/t/unique-composite-fields/14737>\
**Category:** Knacksters' Idea Lab\
**Created:** [August 15, 2023, 6:47pm UTC](https://forums.knack.com/t/unique-composite-fields/14737 "2023-08-15T18:47:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![leithal](https://avatars.discourse-cdn.com/v4/letter/l/9e8a1a/32.png) [@leithal](https://forums.knack.com/u/leithal)\
**Post date:** [August 15, 2023, 6:47pm UTC](https://forums.knack.com/t/unique-composite-fields/14737/1 "2023-08-15T18:47:48Z")

</div>

So I have a calendar, with three components: Office, Date and Shift. Only one person can take a shift at a specific office, on a specific date, for a specific shift.

My first thought was to create a composite field with the three elements, and declare that as unique. However, you can’t designate a formula result as unique.

In DB2 I could chain out to a logical (index) with the office, date and shift and if I got a hit I could throw up an error stating “this shift is already taken”.

I was looking at rules and they don’t seem to accomplish what I’m trying to do…

Another option would be to create a table with every combination of Office, Date and Shift, like in the Volunteer demo app, but don’t really want to create a table with thousands of records, when people don’t sign up for most shifts.

Suggestions?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/knack/original/2X/1/1cc4d07d57e3b02bf1ea38eaede87c1d445a4dc5.png)

 ![Screen Shot 2023-08-15 at 11.39.24](https://us1.discourse-cdn.com/flex020/uploads/knack/original/2X/0/0fd47eb312cff4b5717e9c895cbf2c0a28c4d5ab.png)
