Question
Find the duplicate words from the paragraph Input - A big buck bucket over the big bug bucket Output- big bucket
A
Anonymous
December 18, 2025

Answer

To find duplicate words in an Appian sentence, you split the sentence into words, convert to lowercase (for case-insensitive matching), then use a loop (like a!forEach) with wherecontains() or a dictionary approach to count occurrences, finally filtering for words with counts > 1 to get your duplicates, ensuring data types match.

a!localVariables(
local!sentence: " A big buck bucket over the big bug bucket ",
local!words: fn!lower(fn!split(fn!trim(local!sentence), " ")),
local!duplicatesList: reject(
fn!isnull,
a!forEach(
items: local!words,
expression: if(
length(wherecontains(fv!item, local!words)) > 1,
fv!item,
null
)
)
),
local!uniqueDuplicates: union(
local!duplicatesList,
local!duplicatesList
),
local!uniqueDuplicates
)

Output:

1766092622246-rp0vxbmre9i.png

JuniorSeniorExpressions#coding
Loading comments...
Find the duplicate words from the paragraph Input - A big bu... — Expressions Appian Interview Question | Appian Interview Questions - AppianVerse