Question

Radio and checkboxes - are they possible through CLI and dynamic fields?

  • 22 December 2022
  • 3 replies
  • 202 views

We build our Zapier app via CLI.  I am attempting to add dynamic fields.  The docs for field schema mention only the following as being valid options:

  • string
  • text
  • integer
  • number
  • boolean
  • datetime
  • file
  • password
  • copy
  • code

Is there no way to create a radio button/list or checkboxes?


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 7
Badge +8

Hi @pulse-chris 

 

I haven't seen it as an option before. Checkboxes for example can be used in something like “Create New Records in case no record found” in case its a Find action. But not as part of the zap I guess

Userlevel 4
Badge +9

Hey @pulse-chris 👋

With the CLI, you can build a dropdown that allows for multiple values to be selected.

You would use the list:true property from the field schema you found (nice work!): https://github.com/zapier/zapier-platform/blob/master/packages/schema/docs/build/schema.md#properties-17

and also add a choices property with the values the user selects from in the dropdown: https://github.com/zapier/zapier-platform/blob/master/packages/schema/docs/build/schema.md#fieldchoicesschema 

So inoutFields coded like this:

inputFields: [

      {key: 'name', required: true},

      {key: 'static_dropdown_multi',

label: 'Multi Static Dropdown', required: false, list: true, choices: { 1: 'Choice 1', 2: 'Choice 2', 3: 'Choice 3' } }

    ],

would appear like this in the Zap Editor and allow the user to select more than one:

 

 

Userlevel 4
Badge +9

As choices and dynamic are mutually exclusive in the field schema: https://github.com/zapier/zapier-platform/blob/master/packages/schema/docs/build/schema.md#fieldschema , if you wanted the dropdown to contain dynamic values pulled from a hidden trigger, the code for a dynamic dropdown would look like this:

{key: 'dynamic_dropdown_multi', label: 'Multi Dynamic Dropdown', required: false, list: true, dynamic: species.id.name }

where the value for the dynamic property is a dot-separated string concatenation following this pattern:

The key of the trigger you want to use to power the dropdown. (required)
The value to be made available in bundle.inputData. (required)
The human friendly value to be shown on the left of the dropdown in bold. (optional)

This is further detailed with examples in the CLI docs here: https://github.com/zapier/zapier-platform/blob/master/packages/cli/README.md#dynamic-dropdowns