Skip to main content
SFTP

SFTP - For each directory item

SFTP - For each directory item

Runs a loop over each item of an SFTP directory listed by the SFTP: List directory action, returning the current item on every iteration. Ideal for processing files in batch — downloading, moving or renaming each item of the directory automatically.


Options

List

Select the SFTP: List directory action whose items will be gone through.

Returns

Custom code

js
actions["action-id"].currentItemIndex // index of the current item in the loop (Number)
actions["action-id"].currentItem // current item of the loop (Any)

Field selection

  • currentItemIndex — position of the current item in the iteration (Number)
  • currentItem — current directory item being processed (Any)

Rules and Conditions

  • The List field is required.
  • The actions inside the loop run once for every item of the directory.
  • To read the details of the current item (name, size, type, path and date), use SFTP: Get directory item referencing this loop.