In this article, we'll explore how these functions work and how they can be used to automate complex workflows and processes. As a beginner in no-code development using platforms like Make, you might come across terms like arrays, collections, and JSONs, which can be bewildering. Sometimes we deal with collections of collections or arrays of collections. In these cases, it is required to map values directly from nested arrays of collections.
Now, you may wonder how to extract an item from an array or a nested collection or get an item based on a label, especially when you have multiple items to extract. However, extracting items from an array in Make is easy if you follow a few simple steps.
Getting Excited? Here is the MSquare's Simple Trick
Let's say you've submitted a Calendly form and received output from it. The output consists of a questions and answers array, which contains answers to the questions you asked on the form. For instance, one of the questions might be "What's your company name?", and the corresponding answer might be "MSquare Automation Solutions."
To extract the answer to a particular question, you can use the map() function over the array in Make.
Use the "Set Variable" module to set a variable for the answer you want to extract. For instance, if you want to extract the answer for the "call agenda" question, you can set the variable name as "call_agenda" or any other suitable name.
Next, use the map() function (array function) to extract the answer from the array. The first argument of the map() function is the array you want to extract value from. In this case, it's the questions_and_answers array. The second argument is what you want to extract from the array, which in this case is the answer to a specific question. Use question as the third argument and the fourth should be the actual question present in the collection of array.
Once you've done this, the map() function will extract the answer for the specified question from the array.
Now, to get rid of array datatype in the output, you need to use the get() function over the output produced by map().
Finally, the output is received in the string format as shown below:
In summary, extracting items from an array in Make is easy once you know how to use the map() function. By following the steps outlined above, you can easily extract answers from an array and use them in other apps or integrations.
Conclusion In conclusion, the get and map() functions are essential tools for retrieving and manipulating data from various sources. They allow you to automate complex workflows and processes and customize your data based on your specific requirements. By combining the Get and Map functions with other functions and modules in your Make scenario, you can create powerful and efficient automation workflows that save your time and effort. Make is an excellent tool for automating repetitive tasks, and the Get and Map functions are two of the most important functions you'll use.
Looking to improve your skills in handling array collections? Look no further than our masterclass!
Our expert instructor at Msquare offer an in-depth and comprehensive training program that will teach you everything you need to know about managing and manipulating array collections. Whether you're a beginner or an experienced developer, our masterclass is designed to help you take your skills to the next level.
During this course, you'll learn a variety of techniques and strategies for managing and working with array collections.
So don't wait! Sign up for our masterclass today and start mastering the art of handling array collections like a pro. Get recorded class for just 25 USD!
New to Make?
Use the following link to signup and get 10,000 operations (Pro plan) free on Make for the first month. Later you can choose the plan that suits your requirement