> For the complete documentation index, see [llms.txt](https://docs.emobiq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/flow/map.md).

# map

## Description

Loop through all the elements in a list to apply a specific operation to each element.

Example: loop through a list of numbers to square (operation to be applied) every number.

## Input / Parameter

| Name   | Description                                     | Input Type | Default | Options | Required |
| ------ | ----------------------------------------------- | ---------- | ------- | ------- | -------- |
| values | The list of elements to loop through.           | Array/List | -       | -       | Yes      |
| extra  | Extra parameters stored and passed to callback. | Any        | -       | -       | No       |

## Output

N/A

## Callback

### yesCallback

This will be triggered for every loop that happens within the 'values'.

| Description                                   | Output Type |
| --------------------------------------------- | ----------- |
| The current active value within the 'values'. | Any         |

## Video

Coming Soon.

## Example

The user wants to loop through all the values in an array.

### Step

1. Set a variable "Vmap" using the `setVar` function. Call the function `toArray` in the `value` parameter and set the values for the list.\
   var: Vmap

   ![](/files/JNKWAkHLBSBncbsQAgk7)

   ![](/files/cVfGQtlwHfBHF6x3Aw6Z)

   ![](/files/pXywBuzMFZtJFDmeeTI8)
2. Call the function `map`. Call the function `getVar` in the `values` parameter and enter the variable to get.\
   var : getVar->Vmap<br>

   ![](/files/RzkdkdCn5iXXk3j32QIE)

   ![](/files/10qHbU6QCc0oUmp2I4e3)

   ![](/files/Xuity3b5CCyPxtJCcdac)
3. Add a `console` function to the callback of the `map` function to display the result in the console.

   ![](/files/1PARzp7iMzKkFrbjaB5D)

   ![](/files/FMfd098zWUQampGYWpJQ)

### Result

![](/files/AFVqKsLWnyHkJHgk2MiR)

## Links


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.emobiq.com/emobiq-client/006-actions-and-visual-logic/action-reference/cordova/flow/map.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
