# Set default record on RecordActionTable

**URL:** <https://forum.inductiveautomation.com/t/set-default-record-on-recordactiontable/74155>\
**Category:** Module Development\
**Tags:** ignition81\
**Created:** [May 25, 2023, 1:59am UTC](https://forum.inductiveautomation.com/t/set-default-record-on-recordactiontable/74155 "2023-05-25T01:59:47Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [May 25, 2023, 1:59am UTC](https://forum.inductiveautomation.com/t/set-default-record-on-recordactiontable/74155/1 "2023-05-25T01:59:47Z")

</div>

I'm working on a module and I have a gateway webpage with a RecordActionTable component that keeps track of clients I'm interfacing with. I'd like to set one and only one as a default (so that I can retrieve a default client in my code) - is there an easy way to do this?

Another related question is I would like to force each client's Name to be unique when a new client is being created so that I could retrieve a client by name (sort of like how the SMTP Profiles on the Config section enforce this).

Both of these are probably properties that are added in the ConfigurationRecord that I don't know about.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 25, 2023, 12:36pm UTC](https://forum.inductiveautomation.com/t/set-default-record-on-recordactiontable/74155/2 "2023-05-25T12:36:26Z")

</div>

> [@YF129701](#):
>
> I'd like to set one and only one as a default

If you aren't using an Ignition-controlled value as your primary key (like a device ID in the driver model), then you can arrange for one row to have the "magic" key value that represents your default.

> [@YF129701](#):
>
> force each client's Name to be unique

IIRC, there's a column flag for that--`S_UNIQUE` I think.

---

<div class="post-metadata">

**Author:** ![YF129701](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/yf129701/32/60498_2.png) [@YF129701](https://forum.inductiveautomation.com/u/YF129701)\
**Post date:** [May 25, 2023, 2:14pm UTC](https://forum.inductiveautomation.com/t/set-default-record-on-recordactiontable/74155/3 "2023-05-25T14:14:35Z")

</div>

Do you have an example of using a magic key value for the default?

I thought there was a Unique flag as well, but IntelliJ isn't bringing up any suggestions like it was for other flags:

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/f/bfa007ffa5ff051df2995f93966e915de4b8b3d6.png)

I tried both `SUNIQUE` and `S_UNIQUE` and get the same error.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 25, 2023, 2:24pm UTC](https://forum.inductiveautomation.com/t/set-default-record-on-recordactiontable/74155/4 "2023-05-25T14:24:45Z")

</div>

> [@YF129701](#):
>
> an example

No, I've not had to do anything like that.

> [@YF129701](#):
>
> I tried both `SUNIQUE` and `S_UNIQUE` and

I dug around in my old stuff. It is a property, not a flag. Use it like this:

```auto
    static {
        SomeFieldMeta.putUserProperty(PersistentRecord.UNIQUE, Boolean.TRUE);
    }

```

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [May 25, 2023, 3:01pm UTC](https://forum.inductiveautomation.com/t/set-default-record-on-recordactiontable/74155/5 "2023-05-25T15:01:50Z")

</div>

> [@pturmel](#):
>
> I dug around in my old stuff. It is a property, not a flag. Use it like this:
> 
> ```auto
> static {
> SomeFieldMeta.putUserProperty(PersistentRecord.UNIQUE, Boolean.TRUE);
> }
> 
> ```

`StringField::setUnique` does the same thing.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [May 25, 2023, 3:10pm UTC](https://forum.inductiveautomation.com/t/set-default-record-on-recordactiontable/74155/6 "2023-05-25T15:10:12Z")

</div>

> [@Kevin.Herron](#):
>
> `setUnique`

Good to know for the future. I'm no longer using that bit of code I dug up, and no need expected.
