Get an item from a file list
Function: Get an item from a file list
This action helps you retrieve a specific file from a collection (list) of files based on its position. Imagine you have a folder with several documents, and you want to pick out the third document; this action allows you to do just that. It's useful when you've processed multiple files and need to work with one particular file from that group.
Input
- List: This is the collection of files you want to search through. Think of it as a folder containing multiple documents or images.
- Index: This is a number representing 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 position1, and so on. This input is required.
Output
- Result: This is the single file that was found at the specified position in your list. If no file exists at that position (e.g., the index is too high), this output will be empty.
Execution Flow
Real-Life Examples
Example 1: Retrieving the first invoice from a list
You have uploaded a batch of invoices and want to process the very first one.
- Inputs:
- List:
["invoice_101.pdf", "invoice_102.pdf", "invoice_103.pdf"] - Index:
0
- List:
- Result: The
Resultwill beinvoice_101.pdf.
Example 2: Getting the third image from a gallery upload
A user has uploaded several photos for a product gallery, and you need to display the third photo as the main image.
- Inputs:
- List:
["product_photo_1.jpg", "product_photo_2.jpg", "product_photo_3.jpg", "product_photo_4.jpg"] - Index:
2
- List:
- Result: The
Resultwill beproduct_photo_3.jpg.
Example 3: Attempting to get a file beyond the list's size
You have a list of quarterly reports, but you try to access a report for a quarter that doesn't exist in your list.
- Inputs:
- List:
["report_Q1.docx", "report_Q2.docx"] - Index:
5
- List:
- Result: The
Resultwill be empty, as there is no file at position 5 in the provided list.