I have a Zap that includes running Javascript in response to a trigger. Specifically, when a record enters a view in the project table, the zap adds tasks for that project into the task table. Here’s what the Zap screen looks like for the Run Javascript action:
Input Data
csString 1. Task Record IDs: record id…record id…
Code
//this code is required to turn the string containing record IDs into
//an array of objects. Because the output is an array of objects the following
//steps will run for each record found.
if (inputData.csString == null) {
var listArray = ;
} else {
var listArray = inputData.csString.split(",");
}
var output = ;
var arrayNos = listArray.length;
var i=0;
do {
var thisItem = new String(listArrayti]);
var thisItemObj = {};
thisItemObj.record = thisItem;
output.push({thisItemObj});
i++;
}
while (i < arrayNos);
I’m trying to recreate this Zap using Airtable automation. Step 1, of course, is the trigger. In Step 2, I chose a “run script” action. I pasted the above code into the code pane (center of the “edit script” screen), but need help with the left “Input variables” pane. There are 2 fields in that pane, Name & Value. What should I specifically put into those fields? I’ve tried a few different things, but keep getting a syntax error: “Cannot find name ‘inputData’.(2304)” .
Thank you!