Ask AI
Skip to main content

Create media files

Function: Create media files

Create media files and store them in your application's media library. This action is useful for uploading documents, images, or other files that your application needs to manage, making them accessible within your application.

Input,

  • Files: The files you want to add to your application's media library.
    • Type: A list of FILEs.
    • Required: Yes. You must provide at least one file.

Output,

  • The IDs of the created media files: A list of unique identifiers (IDs) for each file that was successfully added to the media library. This list will be stored in a variable.
    • Type: ARRAY (specifically, a list of VARIABLEs, representing unique IDs).
    • Default Variable Name: MEDIA_IDS. If you don't specify a custom name for the output variable (which is not an explicit input for this action), the list of IDs will be stored in a variable named MEDIA_IDS.

Execution Flow,

Real-Life Examples,

Example 1: Uploading customer profile pictures

Imagine you have a form where users can upload their profile pictures. After they submit the form, you want to store these images in your application's media library.

  • Inputs:
    • Files: [customer_photo_john.jpg, customer_photo_jane.png] (These are the files uploaded by John and Jane through the form.)
  • Result: Two new media entries are created in your application's media library. A variable named MEDIA_IDS is created, containing ["uuid-john-photo", "uuid-jane-photo"]. These unique IDs can then be linked to John's and Jane's customer records in your database.

Example 2: Adding product images for an e-commerce store

When adding new products to your online store, you need to upload multiple images for each product (e.g., front view, side view, detail shot).

  • Inputs:
    • Files: [product_shoe_red_front.jpeg, product_shoe_red_side.jpeg, product_shoe_red_detail.jpeg] (These are the images for a red shoe product.)
  • Result: Three new media entries are created in the media library. The MEDIA_IDS variable now holds ["uuid-shoe-red-front", "uuid-shoe-red-side", "uuid-shoe-red-detail"]. These IDs can be associated with the "Red Shoe" product listing, allowing them to be displayed on the product page.

Example 3: Storing legal documents for a case management system

In a legal application, you might need to upload various documents related to a specific case, such as contracts, client IDs, or court filings.

  • Inputs:
    • Files: [contract_agreement_case123.pdf, client_id_smith.pdf] (These are two documents for a legal case.)
  • Result: Two new media entries are created in the media library. The MEDIA_IDS variable contains ["uuid-contract-case123", "uuid-client-id-smith"]. These IDs can be used to reference the documents directly within the case management system, ensuring easy access and organization.