Implementing FOR loop using Appian Functions

I want to implement a functionality similar to a FOR loop which runs for every item in an array where the control can be defined when to exit the loop. Also i want to return a value when it exits the loop. 

Thanks in advance

  Discussion posts and replies are publicly visible

Parents
  • Hi Yagyadeep, To achieve the combination that you are asking you may need an Expression Rule (with load()/with() function as per the situation) defining your loop function (could be apply() function) to a local parameter, in order to capture the result set upon applying the loop function. After that, you may need another logic inside the definition of the expression, to return the value upon completion of looping function. If you want to return only the value to be returned upon completion of the flow, it will be pretty straight forward in defining the Expression Rule. If you want to return both the looping function result set and the value to be returned upon completion, then you may need little more complexity to be incorporated in your code. Through dictionary format or anonymous CDT you may achieve the same i.e., binding 2 result sets together as one structure.
Reply
  • Hi Yagyadeep, To achieve the combination that you are asking you may need an Expression Rule (with load()/with() function as per the situation) defining your loop function (could be apply() function) to a local parameter, in order to capture the result set upon applying the loop function. After that, you may need another logic inside the definition of the expression, to return the value upon completion of looping function. If you want to return only the value to be returned upon completion of the flow, it will be pretty straight forward in defining the Expression Rule. If you want to return both the looping function result set and the value to be returned upon completion, then you may need little more complexity to be incorporated in your code. Through dictionary format or anonymous CDT you may achieve the same i.e., binding 2 result sets together as one structure.
Children
No Data