Answered

API to Create or Update dropdown list

  • 25 October 2021
  • 5 replies
  • 827 views

API doesn’t specify about this but how can you create or update dropdown list?
I’d like to update a dropdown part of my form with a list of today+7 to today+30 every night.

Currently it looks like
 

 "choices": [

          {

            "id": "OZu7UOnyD***",

            "ref": "52b37520-31e2-4138-875f-1**********",

            "label": "2021/11/01"

          },

          {

            "id": "OGy5ADGC4***",

            "ref": "d8afa58e-a66e-4bd7-af2a-c*********",

            "label": "2021/11/02"

          },・・・]


What’s this ID and ref doing?
Can I just put labels and id & labels automatically created?
It’s very hard to test it since I have to compose the whole other json to update a single question.

 

icon

Best answer by Liz 25 October 2021, 20:03

View original

5 replies

Userlevel 7
Badge +5

Hi @KM_nadja Happy Monday! I hope you had a great weekend. We have documentation here that covers what those IDs/ref’s are and how to update the form. 

Let me know if you have any questions after taking a peek at the docs!

Hi @Liz 
Oh I now see that it’s in “Example” body request.
Thank you for pointing it out.
I only have to dictate “labels”? OK but the PUT method worked even with ids and refs I’m confusing.

I’ve read 20-30 API docs so far, love TypeForm’s design but I have to say API docs is one of the worst.
Still no explanation of which property does what in each filed type.
I have to create a test form with desired field, retrieve it and analyze out of the whole JSON.
To try manipulating among such a long string of JSON...
It’s ridiculously hard to read and re-compose it.

Wish you could divide by Endpoints such as /forms/{formid}/fileds or /forms/{formid}/settings.

Userlevel 7
Badge +5

Hi @KM_nadja I’m not quite sure I understand the question/issue. Are you able to make the call or what specifically are you having trouble with when creating a call to update the form? 

You can find detailed information on the entire JSON in the Create API here, including what each field type is. If you find that we’re missing particular information, please let us know what so I can share this feedback! 

Hi @Liz 
I was able to make the call somehow, thank you for that.

But I have to say it was a bit hard to read through and from the enitre JSON of a form as well as partially manipulating it for testing.

Was it me not finding these specifics in the doc like;

  • “ref” is what you can refer to in logic and redirect, not id
  • only lowercases are allowd in “ref”
  • you can even set these values at Create or Update
     

    "is_trial":false,
    "are_uploads_public":false,
    "pro_subdomain_enabled":false

 

  • if you don’t set thankyou screen the filed is returned with some default one.
  • I’m still not sure what are required attributes and not

?

What I did is

  1. Create a sample form
  2. Retrieve it in raw JSON text
  3. Partially and carefully manipulate the JSON text and then test recreation, taking out what seems to be invalid one by one like ids and links.

 

API docs of Shopify or Clickup is great, explains each attribute is what and dictates required or not, coming with samples in many coding languages. Fonts are more study-friendly, though I do love TypeForm’s UI they look really fantastic for regular users. 

Userlevel 7
Badge +5

Hi @KM_nadja Glad to hear you were able to make the call, and thanks for the feedback. I can share this with the team that creates those docs. 

If you have any other feedback or troubles creating calls, please let me know!

Reply