Skip to main content
Known Participant
Mar 27, 2024 10:44 AM UTC
Question

Subtracting user list

Hi All,

Is there a way to subtract the users in list 1 from the users in list 2 and return list 1 after subtraction?

    9 replies

    mathieud0001
    Genius
    Mar 27, 2024 10:51 AM UTC

    Not sure if the question is worded properly but did you try the difference function? https://docs.appian.com/suite/help/24.1/fnc_set_difference.html 

    Known Participant
    Mar 27, 2024 11:05 AM UTC

    Hi [mention:f5e81b8502fa4e77ad12697686a4fc56:e9ed411860ed4f2ba0265705b8793d05] , 

    The difference function is working fine here but when using list of users it does not give the correct output.

    mathieud0001
    Genius
    Mar 27, 2024 11:34 AM UTC

    It works fine for me. Are you sure, your list of users is in the correct type?

    karumurua531442
    Participating Frequently
    Mar 27, 2024 10:59 AM UTC

    hi [mention:9e801b4ea7ba47db8735359b555491e6:e9ed411860ed4f2ba0265705b8793d05]  may i know what is the type of user list you are holding ?

    Known Participant
    Mar 27, 2024 11:03 AM UTC

    Hi [mention:3510a5189ce1477eaf2e09f5858c87e9:e9ed411860ed4f2ba0265705b8793d05] , the list is of type users.

    konduruc733182
    Inspiring
    Mar 27, 2024 11:06 AM UTC

    Hello [mention:9e801b4ea7ba47db8735359b555491e6:e9ed411860ed4f2ba0265705b8793d05] 

    hoping that your lists are of same type, below is the code that I have tested and working. update the data values with your lists and verify.

    a!localVariables(
      local!data1: a!groupMembers(groupI11).data,
      local!data2: a!groupMembers(groupI12).data,
      symmetricdifference(local!data2,local!data1)
    )

    Known Participant
    Mar 27, 2024 11:26 AM UTC

    Hi konduruc6445, unfortunately it is not working as well for the list of usernames.

    konduruc733182
    Inspiring
    Mar 27, 2024 11:27 AM UTC

    Could you please share the data that you have in both the lists if it is not sensitive.

    davidj137213
    Brainy
    Mar 27, 2024 11:41 AM UTC

    Could you please share your code?