How to Solve Code Integration Issues with Make Collections

Learn how to solve code integration challenges caused by Make Collections. Use tools like Aggregate to JSON and Transform to JSON for smooth data processing.

Published
November 28, 2024

Automation platforms like Make are flexible and powerful, but they have some features that could cause confusion, especially for people who want to use code modules. A common issue comes up when working with Collections.

A Collection in Make is a special type of data structure. It contains key-value pairs.

  • Keys represent specific attributes (e.g., "text" or "speaker").  
  • Values can be anything: text, numbers, dates, arrays, or even other objects.

Even though this data structure is great for storing and handling data within Make, it doesn’t work well with programming languages like JavaScript or Python. These languages expect data in a simpler and more standardized format, like a plain array or a JSON string.

Why Can’t Collections Be Used Directly in Code?

Here’s the problem: collections often contain complex or nested data. Make’s modules can handle these structures, but code modules struggle. They either expect simpler formats like arrays or objects, or they may not understand references or nested data structures that collections often use. Therefore, if you pass a collection directly to a code module, the code will fail.

Fireflies Integration Example

For example, if you pass a Fireflies meeting transcript directly to a JavaScript module to reformat it, the code won’t work. This is because the structure isn’t compatible, and the code will fail to interpret it entirely.  Instead, Fireflies might output transcripts as an array of collections and each collection represents a sentence that contains metadata like:

  • Text: The content of the sentence.
  • Start and End Times: When the sentence was spoken.
  • Speaker ID and Name: Who said the sentence.

While this data is detailed and useful, it’s not ready for code modules. But don't worry, we've found a workaround to fix this problem.  

The Workaround

You need a way to simplify and transform the data to pass it to other modules. In this case, we need a tool in between that can transform these collections into JSON objects or strings. Luckily for us, Make provides some built-in tools to help you do just that. Here are some examples:

  • Aggregate to JSON: Use this module to merge data from multiple items into a single JSON object or string. It’s particularly useful when you have an array of collections and need to consolidate them into a single, flat structure.
  • Create JSON: This module allows you to define and build your own JSON structure by mapping specific keys and values from the data you’re working with.
  • Transform to JSON: Designed for converting Make’s collections into a clean JSON string, this module is perfect for flattening deeply nested or complex data structures.

On the Whole

Collections in Make can be tricky, since the data structure that Make uses is not compatible with most programming languages. In addition, this problem can happen with any module, not only Fireflies. But these simple tools can transform data in a matter of seconds.

What’s a Rich Text element?

The rich text element allows you to create and format headings, paragraphs, blockquotes, images, and video all in one place instead of having to add and format them individually. Just double-click and easily create content.

Static and dynamic content editing

A rich text element can be used with static or dynamic content. For static content, just drop it into any page and begin editing. For dynamic content, add a rich text field to any collection and then connect a rich text element to that field in the settings panel. Voila!

How to customize formatting for each rich text

Headings, paragraphs, blockquotes, figures, images, and figure captions can all be styled after a class is added to the rich text element using the "When inside of" nested selector system.