JavaScript to HTTP works sometimes, fails other times

I’m trying to get a chart from QuickChart by:

  1. Creating an array of dates (they’re all the same value but it shouldn’t matter)
  2. Creating a variable of the JavaScript I’m going to use to get the QuickChart
  3. Sending a request in JavaScript through HTTP to get the QuickChart.

When I copy paste the output of the variable (i.e. the JavaScript) into the HTTP module and run that module by itself, it works.

When I refer to the variable within the HTTP module and run the entire sequence, it works, but ONLY if the variable does not refer to the preceding array, and instead includes the raw JavaScript in full.

It does NOT work when I define the variable with the JavaScript by referring to the previous array, then refer to that variable within the HTTP module. However, again—if I copy paste the output of that variable that referred to the array into the HTTP module, it works.

It seems like it’s not syntax issue, but that the HTTP module can’t refer to the JavaScript variable, if that JavaScript variable refers to the array before it.

Not sure how to fix this, any and all help is appreciated, thank you.

2 Likes

Heyy @Peter_Jivotovski You can try setting up the create JSON module and if needed array aggregator to do this.

To do this, you can use the built-in function:

  • join
    join(array; separator)

The function may have also been covered in the Make Academy tutorials — refer to the Make Academy Course Overview for more info.

Here’s an example of how you can use the function:

"{{join(1.array; """,""")}}"
(copy-paste the above into the field, or type it exactly as shown)

e.g.:

Screenshot 2025-07-31 225942

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

@samliew