Block reference / General

Get file path

List the files in a folder, by full path, into a variable you can loop over.

In both appsWarpX BrowserWarpX Phone

Use this block when a run has to work through files: upload every image in a folder, read each CSV a tool exported, or zip whatever a run downloaded. It gives a list of full paths sorted by name, which Loop data can walk through one at a time. It works only in the WarpX Browser desktop app.

The Get file path block's settings, filled in as in the example below.

Settings

Folder

The whole path of the folder. A leading ~ means your home folder. The folder button opens a folder dialog. A folder that does not exist stops the block with an error.

ExampleC:\Users\me\Pictures\avatars
Include files in subfolders

Off, only the files directly in the folder. On, the files in every folder under it as well. Folders themselves are never listed.

ExampleUnchecked
File extensions

Only files ending with one of these, separated by commas. The dot is optional and case does not matter, so jpg also finds PHOTO.JPG. Empty lists every file.

Example.jpg, .png
Assign to variable

Keeps the list in a variable. It is ticked when you add the block.

ExampleChecked
Variable namewhen Assign to variable is ticked

The variable for the list. The default is files. Read it later as {{variables.avatars}}.

Exampleavatars
Insert to table

Writes each path into a table column as well.

ExampleUnchecked
Select columnwhen Insert to table is ticked

The column to write to.

Examplefile

Every block also has the shared block settings — a description, Disable block and what to do on an error. Fields that take text accept data from earlier blocks.

What it hands on

Hands on the list of paths, such as ["C:\Users\me\Pictures\avatars\01.jpg", "C:\Users\me\Pictures\avatars\02.jpg"], which the next block reads as {{prevBlockData}}. The log line says how many files it found. Leaves by its single output.

Example: Upload a different avatar to each account

  1. Start
  2. Get file path
  3. Loop data
  4. New tab
  5. Upload file
Where Get file path sits in the example workflow.
  1. Put the images in C:\Users\me\Pictures\avatars.
  2. Add Get file path and set Folder to that folder.
  3. Set File extensions to .jpg, .png and leave Include files in subfolders off.
  4. Keep Assign to variable ticked and name it avatars.
  5. Add Loop data, set Loop through to Variable, Variable name to avatars and Loop ID to avatar.
  6. Inside the loop, open the profile page and use Upload file with {{loopData.avatar}} in URL/File path/base64.

Good to know

  • Desktop app only. In the browser extension the block is not in the list.
  • Files are sorted by name the way people count, so 2.jpg comes before 10.jpg. With subfolders on, each folder's files come where the folder sorts.
  • At most 10,000 files. Past that, the list stops and the log line says (stopped at 10,000).
  • A subfolder the app may not read is skipped rather than stopping the block.
  • The list holds full paths, ready for Upload file, Zip or File action's Delete.

See also

  • Loop data — Run the blocks after it once for each row, number, list item or element.
  • Upload file — Put one or more files into a file input on the page, from your computer, a URL or inline data.
  • Zip — Compress files and folders into a zip file, or extract a zip into a folder.
  • Read TXT — Take lines, or pieces between a delimiter, from a TXT file into a variable, optionally deleting them from the file.