Skip to main content

What this the syntax for creating an input field, using the CLI  environment, that allows for multiple values to be supplied?

inputFields:  
{
key: 'FileID',
label: 'File ID',
type: 'string',
helpText: "The IDs of the files to be retrieved.",
required: true,
multiple: true, // ?
list: false,
altersDynamicFields: false,
},
],

When this field is posted, how are multiple values denoted?  A comma-delimited string or an array of strings?

bundle.inputData.FileID = 'A','B'

// OR

bundle.inputData.FileID = ='A','B']

 

Hey @craibuc ,

Great question!

In the CLI, the relevant property is list

When list: true, the user is able to provide multiple values, and Zapier will store them in an array:

For example, a field like this…

{
key: "fruits",
label: "Fruits",
helpText: "Enter some fruits",
list: true
}

...would present like this in the editor (where a new input appears after each entry)…

 

...and by default, bundle.inputData.fruits would be passed as an array:

>"Apple", "Grape", "Watermelon"]

 


If only one value is supplied, is it an array of one item?


Hey @craibuc ,

Yes, if only one value is supplied, it’s formatted as an array of one item. 

For example, here...

bundle.inputData.fruits has a value of c 'Apple' ]