Step-by-Step Guide to Creating an Array with Google Sheets Data on Make.com

Hey there, Make.com users! Today, we're going to tackle a common problem that many of you have been asking about: how to create an array with objects from Google Sheets data. Don't worry, it's not as complicated as it sounds. We'll walk you through it step by step.

Understanding the Problem

Let's say you have some data in Google Sheets that looks something like this:

It isn't an array, but you want to create an array from this info, to look like this:

[
   {
      "value": courses.name(B), // B from table
      "sort": Row number // Row number from table
   },
   {
      "value": courses.name(B), // B from table
      "sort": Row number // Row number from table
   },
   {
      "value": courses.name(B), // B from table
      "sort": Row number // Row number from table
   },
]

So, how do we go about doing this? Let's dive in!

Step-by-Step Solution

The solution to this problem involves using the 'Aggregate to JSON' component in the 'JSON' module. Here's how you can do it:

  1. First, you need to create a data structure within the 'Aggregate to JSON' component.
  2. Next, configure the component to put the course name in the 'value' field, and the row number in the 'sort' field.
  3. After running the scenario, the output of the 'Aggregate to JSON' component should yield the correct JSON string.

Troubleshooting Tips

If you're not getting the expected output, here are a few things you can check:

  • Make sure you've correctly configured the 'Aggregate to JSON' component. The course name should be in the 'value' field, and the row number should be in the 'sort' field.
  • Check your data structure. It should be correctly set up within the 'Aggregate to JSON' component.
  • Ensure that you're running the correct scenario. The output should be generated after running the scenario.

Wrapping Up

And there you have it! By following these steps, you should be able to create an array with objects from your Google Sheets data. Remember, the key is to correctly configure the 'Aggregate to JSON' component and set up your data structure properly. If you run into any issues, don't hesitate to refer back to our troubleshooting tips. Happy coding!

You do have further questions?

Ask your question via E-Mail: Richard@make-app.de
Book a paid Support & Consulting Session
New Make.com user? Sign up through this Affiliate Link to receive 10.000 operations for FREE.