Skip to main content
May 24, 2025
Question

Grid Duplicates

  • May 24, 2025
  • 3 replies
  • 0 views

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. 

    3 replies

    stefanhelzle0001
    May 24, 2025

    Well ... not much detail to work with ... the lookup() function can return the index of a value in an array.

    May 26, 2025

    Hi [mention:422788ce1dc3450b8e6f8a1c6efcd7dd:e9ed411860ed4f2ba0265705b8793d05] 

    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
      )

    amaans4178
    May 26, 2025

    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.