Unit 3 · Make Intermediate: get() and map()

get() and map()

8 min read Updated May 21, 2026

Unit introduction

Welcome to the third unit of the course “Using get() and map() functions”.

In the previous two units, you have learned how to use the get() and map() functions and what you can achieve with each of them.

In this unit, you will build on your knowledge and combine the get() and map() functions to explore the benefits of using them together and why they are such a powerful combination.

Are you ready? Let’s jump into it!

GET-MAP

Let’s explore the get() / map() / get(map()) functions to see a comparison of what you can achieve with each.

get()

  • get() extracts an item from the list.
  • In this example, we are getting the 4th item in the array (the purple boot).

map()

  • map() provides a simple array.
  • In this example, we are mapping all black items (the black t-shirt and black socks).

get(map())

  • get(map()) combines the two functions.
  • In this example, we want to get the price of the second white item.
  • map() provides a simple array with white items, and get() extracts the second item in that array (the white socks with a price of $8).

Element - Selectable image 3 – modal

Let’s look at the differences between the functions in more detail.

The get() function

You would use the get() function when you want to extract a specific value from any object. It can be a single collection, an array of simple objects, or an array of collections.

This function is very similar to direct mapping, but in some cases, you don’t know in advance which fields you will receive.

For example, imagine you work in a bookstore and you have your books collection. Certain books have information on the number of pages, but not all of them. In case a specific book contains the field called numberOfPages, get() is very useful, because you can combine it with if to extract the number of pages:

if(numberOfPages!=null;get(books;numberOfPages))

null here means that either the variable does not exist or it has no value.

Note that it’s not very common to use get() on its own. Most often get() is combined with map().

The map() function

You would use the map() function when you have a complex array with a lot of fields but you want to get a simpler array with only the data that interest you.

For instance, you have a complex array with all the books data and you want to get the IDs of all the books that are not in stock.

Remember that the output of the map() function is always an array.

Combining get() and map()

Usually, you would combine get() and map() when you want to extract a specific item from the map() function.

As map() is an array function, it will always return a new array, even if it contains only 1 record. Because of this, you’d often need to add the get() function in order to extract the actual value you want to map to your target module.

For instance, you would use map() to get a list of book IDs that are not in stock. You get the relevant IDs, but in the form of an array. If you want to use this data in the next module, you will have to use the get() function. Otherwise, when you’d try to map an array to a single field in the next module(s), this would result in the wrong output or in an error.

Scenario use case example

Let’s bring this to life and build a scenario! Work through each stage before you continue.

The aim of this scenario is to extract the price of a specific item (sports socks) from the existing shopping basket.

Click Create a new scenario. Name it Make Intermediate 2-3.

You will use the same JSON string from the previous 2 exercises so you can either clone your Parse JSON module, or copy the JSON and paste it into your JSON string field. You can also start from this blueprint.

Click OK to save the module mapping and then click Run this module only. You should have 6 items in your output bundle.

You will notice that your JSON string outputs a collection with the details of your shopping basket, the date of the order, order ID and total price. The Items list is an array, consisting of 6 collections. This means that your order consists of 6 items. Each item has its item name, price and color.

Now you have your source module and from this you’ll extract the price for the item ‘sports socks’.

Add the Tools → Set multiple variables module to your JSON module.

Under Variables, click Add item.

Under Variable name, write “Price of sports socks”.

Remember that it’s good practice to name your variables to reflect what they contain. As you want to extract the price of sports socks here, the variable name should reflect this too.

Under Variable value, you need to write your function.

Insert the get() function and inside it insert the map() function.

It should look like this: get( map( ; ) ; )

Notice that the map() function needs to be embedded inside the get() function.

You could also use first() here instead of get(), but we want to show get() since it’s a more versatile function.

After map(, insert the shopping_basket.items[] array. From this array you want to get the item price.

Hover over the item_price element to see its raw name. In this case it’s the same - item_price. Type this into the field after the semicolon ;. After that insert another semicolon ;.

Remember that the raw name has to be written exactly the same as you see it under Raw: Value. Here it’s the same as the item label, but this might not always be the case!

Next, you need to define the name of the item that you want to get the price for. Hover over the variable to see its raw name. Here it should be item_name. Type this in the field after the semicolon ;.

Then open the output of the JSON module and find the item you want to extract the information for. Type or copy-paste “Sports socks” between the semicolon ; and parentheses ).

Then type 1 and close the get() function with the closing parenthesis ).

Click OK to save your module mapping.

The final function should look like this:

get( map( 1.shopping_basket.items ; item_price ; item_name ; Sports socks ) ; 1 )

Let’s break it down:

  • In this case map() always provides a simple list (array) with one shopping_basket.items array.
  • get() looks at this array and extracts the first index item from it, that’s why you have number 1 here.

Because the map() function returns an array (and there could be more elements with the given key value), it is necessary to apply the get() function to get its first element.

Note: If you wanted to get the price of a different item, you would substitute Sports socks for a different value, e.g. Jeans A.

Let’s see what you have built and test the scenario!

Click Run once.

Open the output of your Tools → Set multiple variables module. You will see the price of sports socks is 9.

You have now used the get() and map() functions together, well done!

You can use this output data in your further modules. For example, to update your spreadsheets or send a message to your colleagues.

Scenario exercise (optional)

Would you like to try it out on your own?

If the answer is yes, then we have a task for you! Don’t worry, it’s nothing complicated and you can see the solution in a bit too!

Here goes:

TASK: From the same JSON, extract the color of the item “Basic T-shirt” using the get() and map() functions.

You can add another variable to your Tools → Set multiple variables module.

Now take some time to do it on your own and once you are ready click Next to see the solution.

Color of Basic T-shirt solution

Let’s see how to solve this scenario together.

First, you need to add a new variable in your ToolsSet multiple variables module. Click Add item and in the Variable name field write the name that describes your variable. We named it “Color of Basic T-shirt”.

The fastest way to write this function is to copy-paste the function from the first variable in the Variable value field and then change it according to your needs. Instead of item_price, type item_color. Instead of Sports socks, type Basic T-shirt.

Click OK to save your module settings and then Run once to test your scenario.

You should get the output “White”. Notice that you will get two variables now in your bundle, one under the other. You can repeat this for as many items as you’d like.

Why are get() and map() so useful?

You might think that you can achieve the same results with iterators, aggregators, and filters; and you would be right!

With the get() and map() functions, you can do pretty much the same things as with the iterators/aggregators/filters!

However, using the functions map() and get() can save you a lot of credits and time.

You can map the functions directly in the module without using iterators and aggregators — which automatically means using less credits and making your scenarios more efficient and optimized!

Compare the credits number here in the top scenario (which uses an iterator and an array aggregator) and the second scenario (which uses only functions)!