Array Looping

Hello! I have a looping problem.

For each object in an array with index i, I want to loop through each element of the array starting from index i+1. How do I do so?

@Tiffany_Sajoto,

Inside loop use arrvar(i+1) to get item instead of current item

Thanks,
Ashok :slightly_smiling_face:

@Tiffany_Sajoto

Assign myArray = {"Object1", "Object2", "Object3", "Object4"}

For Each item In myArray
    Assign currentIndex = myArray.IndexOf(item)
    For Each innerItem In myArray.Skip(currentIndex + 1)
        // Perform actions with item and innerItem
    End For Each
End For Each


For each Activity | currentItem in yourArrayVar.Skip(1)

  • do your processing e.g. Log the item for training / RnD purpose

Hi @Tiffany_Sajoto

Let Suppose you have str_array= {“Value1”,“Value2”,“Value3”,“Value4”}

Try this:

str_array.Skip(1)

image


For Loop by Skipping First object in Array

Hope it’ll helps you :slight_smile:
Cheers !!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.