Skip to main content
New Participant
Mar 31, 2021 5:24 AM UTC
Question

capturing unselected rows in selection grid

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
    Mar 31, 2021 7:32 AM UTC

    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
    Known Participant
    Mar 31, 2021 7:33 AM UTC

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

    New Participant
    Mar 31, 2021 7:36 AM UTC

    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
    Mar 31, 2021 7:39 AM UTC

    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()})

    New Participant
    Apr 10, 2021 10:45 AM UTC