How to merge multiple collections to one

I am working on creating a planning tool for the field service to automatically generate a schedule or allow customers to schedule an appointment online, where the appointment needs to be planned as efficiently as possible. Using the OpenRoute API, I can calculate the travel times between locations, allowing me to use OpenAI ChatGPT to generate the options.

Before I can proceed, I am working on structuring the data. I have been working on this for quite some time, but this is as far as I’ve gotten.

After the Array aggregator, I want to get the text listed vertically, in a dynamic form (depending on how many coordinates are provided).

I need to receive an output in this format: [lon1, lat1]
[lon2, lat2]
[lon3, lat3]
etc. etc.

How can I achieve this? Using a Text aggregator doesn’t work, as I only get one coordinate as output.

The final script should look like this:

{
“locations”: [
[9.70093, 48.477473],
[9.207916, 49.153868],
[37.573242, 55.801281],
[115.663757, 38.106467]
]


[blueprint (8).json|attachment](upload://AjnrHizY4HiQeKYDWutN7uJHtAt.json) (15.5 KB)

![image|690x156](upload://lBjvHbimF79oHyAr2yhwR34gUqA.png)
![image|479x500](upload://ffxD3c4XsGJodUIBFY2U7dApTZC.png)

Welcome to the Make community!

To allow others to assist you with your scenario, please provide the following:

1. Relevant Screenshots

Please share screenshots of your scenario, any error messages, relevant module fields, and filters in question? It would really help other community members to see what you’re looking at.

You can upload images here using the Upload icon in the text editor:

2. Scenario Blueprint

Please export the scenario blueprint file to allow others to view the mapped variables in the module fields. At the bottom of the scenario editor, you can click on the three dots to find the Export Blueprint menu item.

3. Output Bundles of Modules

Please provide the output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.

A. Upload as Text File

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

B. Insert as Formatted Code Block

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles.
These are the two ways to format text so that it won’t be modified by the forum:

  • Method 1: Type code block manually

    Add three backticks ``` before and after the content/bundle, like this:

    ```
    content goes here
    ```

  • Method 2. Highlight and click the format button in the editor

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

Following these steps will allow others to assist you here. Thanks!

Thanks for your message. Here are the files.
blueprint (8).json (15.5 KB)


output_bundle.txt (974 Bytes)

A text aggreagtor should give you all the values needed as one text. Do you need each set of values to be its own bundle?

Thanks for your message. I had already tried that, but the problem is that I don’t get everything, but only the first coordinates.


Schermafbeelding 2024-09-22 212635

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

@samliew

P.S.: Investing some effort into the Make Academy will save you lots of time and frustration using Make.