Skip to main content
Best answer

Creating a static dropdown with Zapier CLI


Hi,

How would I go about creating a static dropdown using the Zapier CLI?

I have this:

{

key: 'process_type',

required: true,

choices: ["A",”B”, “C”],

}

But I want test1 to be assigned to process_type when I choose A, test2 to process_type when choosing B and so on. 

 

Best answer by ikbelkirasanBest answer by ikbelkirasan

Hi @vinshet - The easiest way to define such a field is to turn the choices into an object where the value (like test1..) is defined in the key and the label (like A, B...) is defined in the value.

For example:

{
  "key": "process_type",
  "required": true,
  "choices": {
    "test1": "A",
    "test2": "B",
    "test3": "C"
  }
}

 

View original
Did this topic help you find an answer to your question?
This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

2 replies

GetUWired
Forum|alt.badge.img+12
  • Zapier Expert
  • 1030 replies
  • May 16, 2022

Hi @vinshet 

You can find all docs on the field choices with label schema here: https://github.com/zapier/zapier-platform/blob/master/packages/schema/docs/build/schema.md#fieldchoicewithlabelschema 

choices: [{ label: 'A', sample: 'test1', value: 'test1' },{ label: 'B', sample: 'test2', value: 'test2' },...]


ikbelkirasan
Forum|alt.badge.img+12
  • Zapier Expert
  • 555 replies
  • Answer
  • May 18, 2022

Hi @vinshet - The easiest way to define such a field is to turn the choices into an object where the value (like test1..) is defined in the key and the label (like A, B...) is defined in the value.

For example:

{
  "key": "process_type",
  "required": true,
  "choices": {
    "test1": "A",
    "test2": "B",
    "test3": "C"
  }
}