How to split and manage multiple bundles from Google Sheets to Google Docs Template

Hello, I explain to you that I am obtaining several bundles with a Google Sheet search rows that are obtained from a bot through a webhook. The issue is that in the template there is a maximum of 16 data to put, and I want to know how I can create, if there are more than 16 bundles, another document is created with the remaining bundles and how do I put that data into the variables since I have this function: {{get(58.explotacion; 1)}} (it would be for all the data up to 16) and I can’t think of any way to obtain all the bundles in an orderly manner. How do I create 1 or 2 or 3… documents based on the bundles obtained since there is a maximum of 16 and also that I obtain all the data and first insert 1 sheet with the first 16 data, then another sheet with 12 other data for example. If someone can help me it would be something incredible.





Looks like you should be using the get function instead of the map function…

  • Get function accesses array items by index.

  • Map function returns an array of collection property values from an array.

For more information, see “Mapping with arrays” below

Here are some useful links and guides you can use to learn more on how to use the Make platform, apps, and app modules. I found these useful when I was learning Make, and hope they might benefit you too —

Getting Started

Help Centre Basics

Articles & Videos

Partner & Custom Apps

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

With the get what happens is that it obtains only 8 values ​​and with the map it obtained the arrays with all the values, the fact is that I want to somehow make that data be put into the template variables and if there are more than 16 data that in the end are 16 variables set for each data so another new document is created with the remaining data

You can split arrays into smaller array by using the slice function to extract a subset of items.

You can use the built-in function slice

e.g.:

{{ slice(57.array; 0; 8) }}
{{ slice(57.array; 8; 16) }}

For more information, see the function documentation in the Help Center.

Hope this helps! Let me know if there are any further questions or issues.

@samliew


P.S.: Did you know, the concepts of about 70% of questions asked on this forum are already covered in the Make Academy. Investing some effort into it will save you lots of time and frustration using Make later!

He gives me this as an answer. What should I do next? Put a function inside the Google Docs template module with a get or what would it be like?
I have put the function: {{ slice(57.array; 0; 8) }} in {{ slice(57.array; 0; 100) }} (so that it gets all the bundles obtained, what should I do with that now
And sorry for asking so much