How to input multiple variables for Custom JS Module

Hi I’m using the custom JS module and It appears in the input field it allows for multiple variables however in the output when in the logs it appears to be one long string rather than multiple variables/inputs.

In the input field I’ve put a long string value and another variable containing a number:


However in the input in the logs its appears as one long string value joint together, the phone number at the bottom I’ve removed portion of should be separate


How do I use multiple variables with this and idealy within my code correctly?

To pass more than one variable to the CJS module, you will need to use VALID JSON.

e.g.:

{
  "variable1": {{2.variable1}},
  "variable2": {{2.variable2}}
}

How to use the Custom JS module?

  1. Map a variable (or a JSON object) into the “Input” field.

  2. Write a function to do something with the input variable. If the input is a JSON, you can reference object properties using dot notation.

  3. Write a final statement to return the call of the function you wrote.

Further Information

If you need help with using Custom JS modules, please create a new thread. This helps keep the forum organized and helps me get to your question faster.

You can also take a look at the official documentation here for more advanced usage:

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.

1 Like