Skip to main content

17 replies

August 25, 2022

Could you please elaborate your requirement? Why you are looking for while and do while logics?

shreeharshan0678
August 25, 2022

Consider I have an integer as a input and I apply condition on that integer. If condition returns true then end of the loop, else again check the condition with decremented value of integer. 

stewart.burchell
August 25, 2022

As others have said you cannot break out of a loop in Appian, you have to let it run to the end of the provided list. Typically what I do is output 'null' when my condition is not met, and the value I do want when the condition is met, and then remove the nulls from the generated list.

shreeharshan0678
August 25, 2022

Thank you, I will look into that.

stewart.burchell
August 25, 2022

Here's trivial example to illustrate the idea:

fn!reject(
  a!isNullOrEmpty,
  a!localVariables(
    local!myList: fn!enumerate(10) + 1,
    a!forEach(
      items: local!myList,
      expression: if(fv!item = 5, fv!item, null)
    )
  )
)