Skip to main content
February 3, 2023
Question

Editable Grid Validation

  • February 3, 2023
  • 5 replies
  • 0 views

Hi Can you guys help me with the code I am trying to give validation for the condition so for  Add client  Dropdown there should be only one active status if same occurs it should throw an validation error.

The issue is I tried using whercontains but add client and is active ....data type are different so it is not working

5 replies

February 3, 2023

Why not you give the validation on the Active columns?

February 3, 2023

I want to compare both Active and Add client coulmn we can have many add client but for that is active column should be one

February 3, 2023

HI [mention:fcf1a5e6adf34e13809d84f2aa434dd5:e9ed411860ed4f2ba0265705b8793d05],

you can try "AND" condition, in which in one contains func you can check for client and in other you can check for Active one. If both are true, then you can provide validation message.

udhayakumars3543
February 3, 2023

We have to use wherecontains() only, the logic needs to be like as below. If you experience data type different error on contains() / wherecontains() fucmtion try casting with tostring, touniforstring, tointeger, etc... functions..

Logic:

if(
count(
wherecontains(
"Active",
touniformstring(
index(
local!data.status,
wherecontains(fv!item.type, local!data.type),
{}
)
)
)
) > 1,
"Only one Active row allowed for each Type",
""
)

mikes0011
Brainy
February 3, 2023
....data type are different so it is not working

When you say something like this, you really also need to include details as to what you mean by "not working" (including the code you're currently trying, not just a screenshot of the grid, as well as the error message you get).

Because in cases like this, the answer we give could be anything ranging from a slight tweak to help correct a data type casting issue required by a finnicky comparison rule (common in Appian), or a total rewrite of your logic to produce something that works better over-all.

The Expression Guru