Skip to main content
March 31, 2021
Question

capturing unselected rows in selection grid

  • March 31, 2021
  • 5 replies
  • 0 views

Hi, 

I have an interface with a selection grid in which multiple rows can be selected, these selected rows are saved into a ri of the CDT type. I have the requirement of capturing and storing all the unselected rows (the rows which were not selected) into a ri. 

Any ways to do this? 

TIA!!

    5 replies

    stefanhelzle0001
    Brainy
    March 31, 2021

    The difference() function should help here. It can not only take strings or numbers, but CDTs as well. Give it a try

    docs.appian.com/.../fnc_set_difference.html

    vamsik0002
    March 31, 2021

    Maybe you can use difference(array1,array2),  where array1 is all the rows, array2 is selected rows.
    difference gives unselected rows

    March 31, 2021

    Thank you for your replies. I had tried difference() earlier but there was an error because the type of both arrays were different. 

    I tried using remove() using the original array and the selected indices and was able to get the unselected rows. 

    stefanhelzle0001
    Brainy
    March 31, 2021

    If the types do not match, the cast() function should help. To cast to a list, just add "?list" to the CDT type. There is no need to do

    typeof({type!YOUR_CDT_TYPE()})

    April 10, 2021