How to combine multipe JSON Strings?

Hello Community,

I’m feeling quite frustrated right now. For about two hours, I’ve been trying to merge two or more JSON strings into one.

Here’s what I’ve done so far: I receive a response from OpenAI and convert that response into structured data. Then, I aggregate a dataset using JSON Aggregate to create a JSON string.

Now, here’s where I’m stuck: how can I combine the different JSON strings from various runs into one?

I’ve tried everything:

  • Aggregate to JSON > Aggregate to JSON
  • Aggregate to JSON > Text Aggregator
  • Aggregate to JSON > Iterator > Aggregate to JSON
  • Aggregate to JSON > Parse JSON > Aggregate to JSON
  • Aggregate to JSON > Set Variable

I even consulted your AI, but it hasn’t been helpful.

I still end up with separate bundles and cannot produce a complete JSON string.

Please help me.

Input Bundles are all the same, but different Name and Content.

[
{
“Name”: “URL 1”,
“SourceArticle”: {
“URL”: “https://xyz.com/”,
“Text”: “Teststring 1”,
“Author”: “”,
“Headline”: “”,
“Language”: “en”,
“SourceName”: “FakeNews”,
“SourceType”: “test”,
“Reliability”: “test”,
“AdditionalInfo”: {
“type”: “Categories”,
“content”: “abc, abc”
},
“PublicationDate”: “2024-08-05T09:35:00+02:00”
}
}
]

1 Like

Welcome to the Make community!

What is the Output bundle of module [176], and what final JSON structure do you want, can you please provide a sample?

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.

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

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles in this manner:

Here are two ways to format text so that it won’t be changed by the forum:

A. Type code block manually
Add three backticks ``` before and after the content/bundle, like this:

```
content goes here
```

B. 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.

This will allow others to better assist you. Thanks!

@samliew

1 Like

Hey @mesios

To simple merge the JSON one by one, you can remove first two substrings and last two substrings from each JSON (remove square and curly brackets from both ends), then join by comma (,) and then finally enclose with {} and .

Regards,
Msquare Automation - Gold Partner of Make
@Msquare_Automation