Answered

Are all the IDs unique?

  • 1 April 2022
  • 4 replies
  • 390 views

Userlevel 4
Badge +2

Hey

I’m looking at the response from the Create and Response API, and I see several different IDs that I understand to be automatically generated by Typeform.

My question is to, what extent are these IDs unique?

For instance, if I retrieve a form, there will be an ID for the form itself, an ID for each field, an ID for each choice for the fields that have defined choices, and so on. See (simplified) example below.

{

    "id": "ybfq1MDc",

    "type": "quiz",

    "title": "Unique IDs?",

    },

    "fields": [

        {

            "id": "WsRgbU2OaDNd",

            "title": "Are these IDs unique?",

            "ref": "01FZJ6C7BT8ZXN7QSBH3V1BDD3",

            "properties": {

                "randomize": false,

                "allow_multiple_selection": false,

                "allow_other_choice": false,

                "vertical_alignment": true,

                "choices": [

                    {

                        "id": "uwxim7rOjZ4h",

                        "ref": "01FZJ6C7BTSPJWWSKG30K2RFAG",

                        "label": "Very unique"

                    },

                    {

                        "id": "XMjhFBI6Ukqb",

                        "ref": "01FZJ6C7BTR13K16VA3QF1N585",

                        "label": "Hardly unique at all"

                    }

                ]

            }

        },

        {

            "id": "p2jh47vRZi4v",

            "title": "What about these?",

            "ref": "d9e06a1c-0410-4873-a37f-6644ef870d73",

            "properties": {

                "randomize": false,

                "allow_multiple_selection": false,

                "allow_other_choice": false,

                "vertical_alignment": true,

                "choices": [

                    {

                        "id": "VN1lfjHUuc8y",

                        "ref": "4c991169-8cbf-4310-bbfa-6ea3a077be25",

                        "label": "Yes!"

                    },

                    {

                        "id": "9TlrQQmWlETM",

                        "ref": "44d671f8-3415-4e29-936d-e10af0f83df4",

                        "label": "Not this one"

                    }

                ]

            },

            "validations": {

                "required": false

            },

            "type": "multiple_choice"

        }

    ]

}

I’m fairly confident that the ID for the form is unique across all forms on Typeform. Likewise, the ID for a field is surely unique across all fields in that form. Is it unique across all fields in all forms in that workspace? All fields in all forms for that account? All fields for all forms across all of Typeform?

What about the ID for a choice? Is it unique across all choices for that form? Or - I’m hoping - across all choices defined in all forms, on Typeform?

I hope my question makes sense. Please let me know if that’s not the case, or if I should elaborate in some way.

Regards,

Mikkel

icon

Best answer by Liz 1 April 2022, 18:44

View original

4 replies

Userlevel 7
Badge +5

Hi @Mikkel Happy Friday! This is a great question. 

Yes, all IDs are completely unique between forms and accounts. This means that if you have an ID within your form, it is unique to that form and won’t be used anywhere else, even including other Typeforms not in your account. 

The only ID that isn’t always unique is the Network ID, which is shown after a respondent submits the answer. This is because it is tied to where the respondent answers the form. So, for example, say I submit your typeform on my computer twice. Then, the same Network ID would show for both submissions since those submissions were connected to my computer. 

I hope this helps! 

Userlevel 7
Badge +5

Hi @Mikkel 
Exactly @Liz said, IDs are unique.

You may also have seen each field, and option have also a ref for reference. You can modify it to be the value of your choice. A ref is unique per form, but you could use the same ref across forms.
 

Userlevel 4
Badge +2

@Liz 

Thank you for a quick and thorough answer! 

That is an even more convenient set-up than I was hoping for - so definitely great news. The part about the Network ID is also going to come in handy.

@picsoung 

Thanks! I’d already figured out that the reference had to be unique per form (due to having received a couple of, ahem, error messages from the API), but it’s good to have confirmation.

Regards,

Mikkel

Userlevel 7
Badge +5

Happy you got some interesting answers, @Mikkel! Don't forget to share your form with us so we can give you some feedback! 

Hoping you have a great week! 😉

Reply