Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

Skip inside the for each loop

Hi All,

Consider a scenario where  ,I am looping on an array of 100 values.

I got the value which i was looking at the index of 20 . then i need set 2 variables with predefined values and skip rest of the looping in for each.

Could you please let me know if it is possible ? sample code is really appreciated .

Thanks in advance

Raj

  Discussion posts and replies are publicly visible

Parents
  • HI Raj,

    1-> one statement is not clear here : "hen i need set 2 variables with predefined values " .

    2-> if you want to skip the loop or simply i say you just want to terminate the loop like we do in java/c# with the help "break" keyword that is not possible in Appian loop till now.

    3-> And if the requirement is like you want to replace some value( the index which you don't know) in array but you don't know the index then you can use wherecontains function , it will return you the index for the value which you are searching and now you have the index value so you can do further process.


    Regards
    Abhay Giri
Reply
  • HI Raj,

    1-> one statement is not clear here : "hen i need set 2 variables with predefined values " .

    2-> if you want to skip the loop or simply i say you just want to terminate the loop like we do in java/c# with the help "break" keyword that is not possible in Appian loop till now.

    3-> And if the requirement is like you want to replace some value( the index which you don't know) in array but you don't know the index then you can use wherecontains function , it will return you the index for the value which you are searching and now you have the index value so you can do further process.


    Regards
    Abhay Giri
Children
No Data