Ask AI
Skip to main content

Generate data from csv

Function: Generate data from csv

This function allows you to easily convert data from a CSV (Comma Separated Values) file into a structured list of records within your application. It uses a predefined "Data Format" as a blueprint to understand how to interpret the columns and rows in your CSV file, making it simple to import external data without any coding.

Input,

  • Data Format (Required, Type: DATA_FORMAT) The blueprint that defines the structure of each record you expect from your CSV file. This tells the system what kind of data (text, number, date, etc.) each column in your CSV represents.
  • File (Required, Type: FILE) The CSV file you want to process. This file should already be uploaded and available in your application's media library.
  • Delimiter (Required, Type: STRING, Default: ;) The character used to separate values in your CSV file. Common delimiters include a comma (,), semicolon (;), or tab (\t).
  • Has Header Row? (Required, Type: BOOLEAN, Default: true) Indicate whether the first row of your CSV file contains column names (a header) or if it contains actual data. If set to true, the first row will be skipped when parsing the data.

Output,

  • Parsed Data (Type: ARRAY) A list of records, where each record matches the structure defined by your chosen Data Format. This list will be stored in a variable within your application, ready for further use.

Execution Flow,

Real-Life Examples,

  1. Importing a List of New Products Imagine you receive a CSV file from your supplier containing details for new products. You have a "Product Details" Data Format already set up in your application.

    • Inputs:
      • Data Format: Product Details
      • File: new_products.csv
      • Delimiter: ,
      • Has Header Row?: true
      • Output Variable Name: NewProductList
    • Result: The NewProductList variable in your application will contain a list of product records, each with fields like ProductName, Price, SKU, etc., ready to be added to your inventory.
  2. Processing Daily Customer Feedback Your customer service team collects daily feedback in a CSV file, and you want to analyze it. You have a "Feedback Entry" Data Format.

    • Inputs:
      • Data Format: Feedback Entry
      • File: customer_feedback_2023-10-27.csv
      • Delimiter: ;
      • Has Header Row?: true
      • Output Variable Name: TodayFeedback
    • Result: The TodayFeedback variable will hold a list of customer feedback entries, each containing details like CustomerName, Rating, Comments, etc., which you can then use for reporting or further actions.
  3. Loading Application Configuration Settings You have a simple CSV file that stores application settings, but it doesn't have a header row, and values are separated by a pipe |. You have an "App Setting" Data Format.

    • Inputs:
      • Data Format: App Setting
      • File: app_config.csv
      • Delimiter: |
      • Has Header Row?: false
      • Output Variable Name: ApplicationSettings
    • Result: The ApplicationSettings variable will contain a list of configuration items, where each item corresponds to a row in your CSV, allowing your application to dynamically load settings.