Incrementing index in multiple assign activity

I’m wondering if I can safely use the ordering in a multiple assign activity to increment a variable after use.
Here is my example code.
Will this safely always increment my index var after it has been used? The documentation of multiple assign states that it all happens simultaneously. What is best practice when it comes to incrementing in UiPath?


no problem you can use Mutiple assign activity for increment but when an error occurred it will difficult to find the error in the multiple assign activity.

if you want you can aslo use assign activity for incrementing


1 Like

Yes, it will work as intended. The index variable referenced in the “theFile” assign statement will pull the current value of the index variable (which has not yet incremented in this case)

For example, lets say we have a list of 10 file names and want to loop through them, printing each name to console at each index.

It will start with index 0 and increment immediately after in the multiple assign.

1 Like

Thank you! I assumed this was the case but I felt the need to ask so it didnt randomly change order for some reason during runtime :smiley:

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