How to Solve Code Integration Issues

How to Solve Code Integration Issues

Automation platforms like Make are flexible and powerful, but they have some features that could confuse, 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.