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

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:

  1. a!forEach : Iterates through each element in local!data.
  2. fv!item : Represents the current item in the loop.
  3. wherecontains(fv!item, local!data) : Finds all positions where the current item appears in the array.
  4. count(...) > 1: If the item appears more than once, it’s a duplicate.
  5. if condition true → fv!item Duplicate values are returned.
  6. else → {}: Non-duplicate values return an empty list.
  7. duplicate items returns duplicate items but it will be repeated to remove it used union

Output:

1765852109734-ps1sxe36qcr.png

JuniorSeniorExpressions#sailcoding#coding
Loading comments...
In Appian, write an expression rule to find duplicate values... — Expressions Appian Interview Question | Appian Interview Questions - AppianVerse