Uniqueness based on two picklist fields

Uniqueness based on two picklist fields

oussama.elaamouchi
Contributor Contributor
747 Views
1 Reply
Message 1 of 2

Uniqueness based on two picklist fields

oussama.elaamouchi
Contributor
Contributor

Hi everyone,

 

i am trying to create unique workspace entrys based on two important informations, which are Name and Month.

oussamaelaamouchi_0-1707998621593.png

My goal is to secure that no combination of Name + Month is created more than once. 

For Picklist fields i can not find any Option for Uniqueness based on two fields. 

 

oussamaelaamouchi_1-1707999240609.png

oussamaelaamouchi_2-1708000192309.png

 

I tried to create an new single line text Field named "Combi" where i combine the two fields with the computed field formula.

 

oussamaelaamouchi_3-1708000460932.png

 

The fields will have the same information in the Combi field but the Uniqueness wont work. 

oussamaelaamouchi_4-1708000646709.png

 

Is there any other work around to ensure an Uniqueness of two picklist fields?

 

Best Regards

Oussama

 

 

 

0 Likes
748 Views
1 Reply
Reply (1)
Message 2 of 2

philipfrench
Collaborator
Collaborator

Yes, I think you are correct, there is not the option that you need.

 

Values set by script, or computed fields, do not have their field-level constraints enforced (including any uniqueness)

They are enforced by the UI, and the API.

 

I suggest combine this into a single picklist, based on a workspace, eg “Month Options” workspaces

 

Pre-load the values you need by importing something like this.

You just need the single column, but if you want to have any other columns that you can derive-in then this might help.

You can add a computed field into the picklist, to determine number of months eg TODAY  minus  the Option Value

This could be an integer, that you then refer to in the picklist.

This would allow the picklist to only show values that are in future, or past, or perhaps up to XXX months in the future, etc.

If you need this ability and cannot figure out the formula, ask this again on the forum.

 

Anyway, create a picklist to this workplace and your user will select YYYY + MM combination.

 

Then apply a uniqueness constraint on this single picklist value.

 

philipfrench_0-1708001807327.png

 

0 Likes