Question
In Appian, write an expression rule to find duplicate values from an integer array.
Input: { 1, 2, 3, 1, 4, 8, 9, 4, 3 },
Expected Output: {1,3,4}.
A
Anonymous
December 16, 2025
87
Answer
a!localVariables(
local!data: { 1, 2, 3, 1, 4, 8, 9, 4, 3 },
local!duplicateItems: a!forEach(
items: local!data,
expression: if(
count(wherecontains(fv!item, local!data)) > 1,
fv!item,
{}
)
),
union(
local!duplicateItems,
local!duplicateItems
)
)
Let’s break this down:
- a!forEach : Iterates through each element in local!data.
- fv!item : Represents the current item in the loop.
- wherecontains(fv!item, local!data) : Finds all positions where the current item appears in the array.
- count(...) > 1: If the item appears more than once, it’s a duplicate.
- if condition true → fv!item Duplicate values are returned.
- else → {}: Non-duplicate values return an empty list.
- duplicate items returns duplicate items but it will be repeated to remove it used union
Output:

JuniorSeniorExpressions#sailcoding#coding
Loading comments...