Ask AI
Skip to main content

Get an item from a file list

Function: Get an item from a file list

This action helps you pick out a specific file from a collection or list of files. Imagine you have a folder full of documents, and you want to grab the third document in that folder. This action allows you to do just that by specifying its position in the list.

Input

  • List: A collection of files from which you want to retrieve a single item. (Type: ARRAY of FILE)
  • Index: The position of the file you want to get from the list. The first item in the list is at position 0, the second at position 1, and so on. This input is required. (Type: NUMBER)

Output

  • Result: The specific file that was found at the given position in your list. (Type: FILE)

Execution Flow

Real-Life Examples

Example 1: Getting the first uploaded document

Imagine you have a form where users can upload multiple documents, but you always need to process the very first document they uploaded.

  • Inputs:
    • List: [Document_A.pdf, Document_B.docx, Document_C.xlsx] (This would be a variable holding the list of uploaded files)
    • Index: 0
  • Result: The action retrieves Document_A.pdf and stores it in the 'Result' output, ready for further processing.

You have an image gallery on your page, and you want to show the fifth image in a prominent spot.

  • Inputs:
    • List: [image1.jpg, image2.png, image3.gif, image4.jpeg, image5.webp, image6.bmp] (A variable containing all images in the gallery)
    • Index: 4
  • Result: The action retrieves image5.webp and makes it available as the 'Result' output, which you can then use to display the image.

Example 3: Retrieving a specific report from a generated list

After running a data analysis, your system generates a list of report files. You know that the summary report is always the second item in this list.

  • Inputs:
    • List: [Detailed_Report_Q1.csv, Summary_Report_Q1.pdf, Raw_Data_Q1.zip] (A variable holding the list of generated report files)
    • Index: 1
  • Result: The action retrieves Summary_Report_Q1.pdf and provides it as the 'Result' output, allowing you to send it via email or save it to a specific folder.