Hi, I am using a grid field and a rule input to save the selected rows, but all the selected row values are not saved in the rule input. Suppose I am selecting four rows only the value of 2 rows is saved in the rule input. When I select all the rows at once this is a problem. But if I select one row after other it doesn't create a problem.Attaching the code snippet for reference:
Any help in this regard will be appreciated.
Discussion posts and replies are publicly visible
What is it supposed to do? More details on the requirement might help us understand the expression or what you have tried.
Any response for the above?
Hi, I don't understand why else condition logic would work according to you. but here is the logic for your requirement, you can optimize it ->
selectionSaveInto: { ri!selectedItems, a!save( local!currentSelectedRow, fv!selectedRows ), a!save( local!currentDeSelectedRow, fv!deselectedRows ), if( contains( touniformstring( property( ri!selectedRow, "id", "" ) ), tostring( property( local!currentSelectedRow, "id", "" ) ) ), {}, { a!save( ri!selectedRow, append(ri!selectedRow, fv!selectedRows) ) } ), if( rule!CPPS_checkIsNull(local!currentDeSelectedRow), {}, a!save( ri!selectedRow, remove( ri!selectedRow, wherecontains( tostring( index( local!currentDeSelectedRow, "id", "" ) ), touniformstring( index( ri!selectedRow, "id", "" ) ) ) ) ) ), },