Skip to main content

4 replies

stefanhelzle0001
Brainy
June 20, 2022

You have seen the documentation? What did you try?

The hard facts about how it works is this: docs.appian.com/.../Expressions.html

richardm900458
Inspiring
June 20, 2022

I would recommend reading this first:
https://docs.appian.com/suite/help/22.2/fnc_looping_any.html
Then try to specify, your exact question. This supports us to help you more detailled.

rameshp162983
New Participant
September 30, 2026

Let's understand the Appian prime-number code step by ste,

a!localVariables( local!number: 17,

if( local!number < 2, local!number & " is not a Prime Number",

if(

any(

a!forEach(

items: enumerate(local!number - 2) + 2,

expression: mod(local!number, fv!item) = 0 ) ),

local!number & " is not a Prime Number",

local!number & " is a Prime Number"

)

)

)

 

 

/* 

 
any(...)

checks whether at least one value is true.

 
any({false, false, false, ...})

Result:

 
false
New Participant
October 1, 2026

The way any() checks a list and stops once it finds a matching condition makes sense. I’ve run into a similar idea when working with large lists of options outside of development too — sometimes you just want to know whether at least one item matches what you’re looking for instead of checking everything manually. That’s actually why I like tools that let me narrow down lots of choices quickly. I was recently doing something similar while going through different drink combinations, where filtering by flavors is much easier than scanning a huge list one item at a time.