Skip to main content
August 10, 2023
Question

Same Sort Field value for more than one column

  • August 10, 2023
  • 5 replies
  • 1 view

Hi Everyone 

I have a grid field in which 3 columns are populated by the same DB column and I also want to set same sort Field value for them.

Is there any way to set so because when I try it throws an error that Sort Field value must be unique. 

5 replies

konduruc733182
August 10, 2023

Hello harshw0876,

Can you please show us the expression or screenshots of your error.

mathieud0001
Brainy
August 10, 2023

You can't use the same field twice in a grid to sort. I think possibly the only way you could do this is to create 2 additional custom record fields.

mikes0011
Brainy
August 10, 2023

Generally the best approach here is to just define the sort field for only the first column in such a collection, and leave the other columns alone.  Out of curiosity, why do you have 3 columns for the same underlying field?  Have you considered consolidating these into one column (or at least, fewer than 3)?

The Expression Guru
August 11, 2023

Actually I have a migration project in which as you said they consolidated 3 columns in one but now I separated those columns and want same sort field to be there

mikes0011
Brainy
August 11, 2023

If they're the same column in the DB / CDT, then they're the same column.  What is "separated" about them, if they aren't represented by separate elements within the CDT?

The Expression Guru