Can I reference input variables directly in the Code module without mapping them one by one?

Status: Open · Asked by Joaquin Rojas on · 0 views

joaquinrojas42 — Question ·

Hi! I'm using the Code (JavaScript) module in a workflow and I currently map input variables one by one like this:

const sub0_media_source = " ";
const sub0_media_image = " ";
const sub0_type = " ";
const sub1_media_source = " ";
const sub1_media_image = " ";
const sub1_type = " ";
// and so on...

Is there a way to access these variables directly from the input data as an object or JSON, without mapping each one manually in the input fields? For example, something like input["sub0_media_source"] inside the code?

It would save a lot of time when dealing with 10+ values. Thanks in advance!

Arshil Ahmad — Reply ·

Hi @joaquinrojas42,

Could you please share the Workflow URL where you have this concern?

Arshil Ahmad — Reply ·

Please disable 'Simple Response', then click on the 'Save & Send Test Request' button to see if that gives you the desired result.

Back to all forum threads · Log in to reply