I have an editable grid where I can validate if the grid contains any duplicates. I m able to write the validate message but I need to get the index or highlight the row where duplicates actually exists.
Discussion posts and replies are publicly visible
Well ... not much detail to work with ... the lookup() function can return the index of a value in an array.
Hi reenab0003
Using the below code you will be able to find the index of the duplicates
a!refreshVariable( value: a!forEach( items: local!data, expression: if( length( wherecontains(fv!item.firstName, local!data.firstName) ) >= 2, fv!item.studentId, {} ) ), refreshOnVarChange: local!data )
For highlighting, you can use the Validation parameter of input field, or display an icon using richText, depending on the column content of your grid.
To identify the index of duplicate values, you can use the wherecontains() function.
wherecontains()