Question
In Appian, Find vowels in the given array using expression rule. Expected output : {
{
word: "Apple",
vowels: {"A","e"}
},
{
word: "Sky",
vowels: {}
},
{
word: "Orange",
vowels: {"O","a","e"}
},
{
word: "Fly",
vowels: {}
}
}
A
Anonymous
May 20, 2026

Answer

a!localVariables(
local!words: { "Apple", "Sky", "Orange", "Fly" },
a!forEach(
items: local!words,
expression: a!localVariables(
local!word: fv!item,
{
word: local!word,
vowels: reject(
fn!isnull,
a!forEach(
items: enumerate(len(local!word)) + 1,
expression: a!localVariables(
local!char: mid(local!word, fv!item, 1),
if(
contains(
{
"a",
"e",
"i",
"o",
"u",
"A",
"E",
"I",
"O",
"U"
},
local!char
),
local!char,
null
)
)
)
)
}
)
)
)

How it works step-by-step:

  1. Outer Loop (a!forEach): Iterates through each word in the local!words array ("Apple", "Sky", etc.).
  2. Character Splitting: enumerate(len(local!word)) + 1 generates a sequence of numbers from 1 to the length of the current word. The mid() function uses these numbers to extract each character one by one.
  3. Vowel Checking: The if() and contains() functions check if each extracted character matches a predefined list of uppercase or lowercase vowels. Non-vowels are replaced with null.
  4. Cleanup (reject): The reject(fn!isnull, ...) function filters out all the null entries, leaving a clean list of only the vowels found in that word.


Output:

Image 101



SeniorJuniorExpressions#coding
Loading comments...