Ask AI
Skip to main content

Map to attribute

Function: Map to attribute

This action helps you transform a list of detailed items into a simpler list containing only a specific piece of information from each item. Imagine you have a spreadsheet with many columns, and you only need one column's data. This action does exactly that for your data lists.

Input,

  • Array: This is the original list of items you want to process. Each item in this list can contain multiple pieces of information.
  • Attribute: This is the specific piece of information (like a field or column name) you want to extract from each item in your original list. For example, if your list contains "Customer" items, you might want to extract the "Email" attribute.

Output,

  • The mapped array name: This is the new list created by the action. It will contain only the extracted values of the specified attribute from each item of your original list.

Execution Flow,

Real-Life Examples,

Example 1: Extracting Product Names from an Inventory List

You have a list of all products in your inventory, and you want to quickly get a simple list of just their names to display on a webpage.

  • Inputs:
    • Array: [ \{ "ID": "P001", "Name": "Laptop Pro", "Price": 1200 \}, \{ "ID": "P002", "Name": "Wireless Mouse", "Price": 25 \}, \{ "ID": "P003", "Name": "External Monitor", "Price": 300 \} ]
    • Attribute: "Name"
  • Result: A new list containing [ "Laptop Pro", "Wireless Mouse", "External Monitor" ] is created, which you can then use for your webpage.

Example 2: Gathering Customer Email Addresses for a Newsletter

You have a list of all your registered customers, and you need a list of their email addresses to send out your weekly newsletter.

Example 3: Listing Order IDs for a Daily Report

At the end of the day, you want a simple list of all the order IDs that were processed to include in your daily sales report.

  • Inputs:
    • Array: [ \{ "OrderID": "ORD-2023-001", "Customer": "Alice", "Total": 150.00 \}, \{ "OrderID": "ORD-2023-002", "Customer": "Bob", "Total": 75.50 \}, \{ "OrderID": "ORD-2023-003", "Customer": "Charlie", "Total": 220.00 \} ]
    • Attribute: "OrderID"
  • Result: A new list containing [ "ORD-2023-001", "ORD-2023-002", "ORD-2023-003" ] is created, which can be easily added to your report.