Issue in fn!union() to return unique values. Is there any other function available?

Hi Team,

Got confused while doing some calculations in Appain Expression rule. Added input and output below. i have tried fn!union() function but it was failing sine input was only one array.

Code: fn!union({ 1, 2, 2, 1, 3, 1, null, null }, {})

Sample i/p -> { 1, 2, 2, 1, 3, 1, null, null}

Expected o/p -> { 1, 2, 3} 

Current Appian Design:

Thanks and Regards,

Vigneshkumar Radhakrishnan

  Discussion posts and replies are publicly visible

Parents Reply
  • What does union mean? set of all unique elements from multiple sets. So, there should be more than one array to perform a union right? it is mentioned in the documentation on the Expression rule designer as well that atleast two arrays are required for union to work as expected although it can take n number of arrays. Consider this as sum of numbers which always require more than one number to execute.

    Now, you can try what other contributors suggested (passing the same array as second parameter) or you can fool Appian by passing an empty list as a second parameter which would also yield the same result.

    union({ 1, 2, 2, 1, 3, 1, null, null }, tointeger({}))

Children
No Data