Skip to main content
Best answer

Zapier platform problem: Cannot make static dropdown with key value pairs


I'm building a connection on the Zapier platform, and I am trying to make a static dropdown with key-value pairs as per https://platform.zapier.com/docs/input-designer#keyvalue. It is not working

1. The simple example of ["one", "two","three"] does work, but the key-value pair example on that page does not work, even without the suspicious backticks. This is the example: [ '{ “sample”: “1”, “value”: “1”, “label”: “Pork” }, { “sample”: “2”, “value”: “2”, “label”: “Fish” } ]`

2. I'm not sure if the "sample" in the example is required and what purpose it serves.

Thanks in advance!

Charles


Best answer by ikbelkirasanBest answer by ikbelkirasan

Hi @Charles_CBCPL

The static dropdown can be declared with 2 methods:

  1. Using an array of values like you've shown in the first example.
  2. Or using an object where the keys are the actual "values" and the values are considered "labels".

For example:

{

"1": "Pork",

"2": "Fish"

}

I'm not sure about the other way you mentioned because I haven't used it before.


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.

6 replies

ikbelkirasan
Forum|alt.badge.img+12
  • Zapier Expert
  • 555 replies
  • Answer
  • March 6, 2020

Hi @Charles_CBCPL

The static dropdown can be declared with 2 methods:

  1. Using an array of values like you've shown in the first example.
  2. Or using an object where the keys are the actual "values" and the values are considered "labels".

For example:

{

"1": "Pork",

"2": "Fish"

}

I'm not sure about the other way you mentioned because I haven't used it before.



I appreciate your help, but your example isn't working either. I input it as in screenshot 1, then save it and I get a confirmation, but when I check again, it's gone as in screenshot 2. Thanks.

Screenshot 1

form-editor.PNGScreenshot 2

form-editor2.PNG



jesse
Forum|alt.badge.img+9
  • Architect
  • 1348 replies
  • March 11, 2020

@ikbelkirasan do you have any other ideas around this? If not, we're happy to escalate this one to our developer team. Let us know!



ikbelkirasan
Forum|alt.badge.img+12
  • Zapier Expert
  • 555 replies
  • March 11, 2020

@jesse it should work the way I described (see the screenshot below).

image.png

@Charles_CBCPL - If you look closely, you'll find a comma there which makes the JSON invalid, that's why you see the red cross mark. Remove it and it should work as you can see above.

image.png



@ikbelkirasan. It’s the little things sometimes… Thanks for pointing out my error. Everything is working as it should.


ikbelkirasan
Forum|alt.badge.img+12
  • Zapier Expert
  • 555 replies
  • March 18, 2020

@Charles_CBCPL Awesome, glad it worked! :)