Get a data item from a map
Function: Get a data item from a map
This action allows you to retrieve a specific piece of information from a collection of data, often referred to as a "map" or "dictionary." Think of a map as a list where each item has a unique label (a "key") that helps you find it. This action is useful when you have a collection of related data and need to extract a particular value based on its label.
Input
- Map: The collection of data (like a list of settings or properties) from which you want to retrieve an item. This map contains various pieces of information, each identified by a unique key.
- Key: The specific label or identifier for the data item you want to find within the Map. For example, if your map contains user details, the key might be "EmailAddress" to get the user's email. This input is required.
- Data format: This specifies the expected type or structure of the data item you are trying to retrieve (e.g., a simple text, a number, a date, or a more complex object structure). This helps the platform correctly interpret and use the retrieved information. This input is required.
Output
- Result: The specific piece of information found in the Map that matches your provided Key. If the Key is not found in the Map, the Result will be empty or not set. The type of this output will match the "Data format" you specified.
Execution Flow
Real-Life Examples
Example 1: Retrieving a Product Price
Imagine you have a list of product details, and you want to get the price of a specific product.
- Inputs:
- Map: A collection of product attributes, for example:
\{
"ProductName": "Wireless Headphones",
"Price": 99.99,
"SKU": "WH-1001",
"InStock": true
\} - Key: "Price"
- Data format: NUMBER
- Map: A collection of product attributes, for example:
- Result: The action will output
99.99as theResult.
Example 2: Getting a User's Email Address
You have a user's profile information stored in a map, and you need to extract their email address.
- Inputs:
- Map: A user's profile, for example:
\{
"FirstName": "Alice",
"LastName": "Smith",
"EmailAddress": "[email protected]",
"UserID": "AS123"
\} - Key: "EmailAddress"
- Data format: EMAIL
- Map: A user's profile, for example:
- Result: The action will output
[email protected]as theResult.
Example 3: Checking an Order Status
You're processing an order and need to know its current status from a map containing order details.
- Inputs:
- Map: Order information, for example:
\{
"OrderID": "ORD-456",
"OrderDate": "2023-10-26",
"OrderStatus": "Shipped",
"TotalAmount": 150.00
\} - Key: "OrderStatus"
- Data format: STATUS
- Map: Order information, for example:
- Result: The action will output
Shippedas theResult.