Skip to main content
Known Participant
Sep 19, 2022 9:08 AM UTC
Question

Compare two arrays and find items that are missing in second array

I have 2 arrays that they are identical at first but the user may remove (not able to add but just remove) items from the second array. I want to find items that are in the first array but not in the second one.
How can I do it?

3 replies

harshitb6843
Brainy
Sep 19, 2022 9:11 AM UTC

You can use the difference() function. 
docs.appian.com/.../fnc_set_difference.html

joaoc1131Author
Known Participant
Sep 19, 2022 9:17 AM UTC

something like this?

a!localVariables(
  
  local!A:{2;3;4},
  local!B:{2;4}
  
  difference(local!A,local!B)
  
)

harshitb6843
Brainy
Sep 19, 2022 9:18 AM UTC

Yes