Is there anyway to receive the unique name for a form field within the API

  • Profile Image
    HospiceUK
    Asked on October 09, 2017 at 05:24 PM

    Hi, is there anyway to receive the unique name for a form field within the API? If not, can we please have it added? Much better to reference the unique name than the full text - especially if the text is really long.

    thanks,

    Andrew



  • Profile Image
    jonathan
    Answered on October 09, 2017 at 09:25 PM

    Andrew,

    I am sorry I was not able to fully understand what you are after. Can you please provide more clearer details.

    User guide: How to Find Field IDs and Names

    We will wait for your updated response.


  • Profile Image
    HospiceUK
    Answered on October 10, 2017 at 04:28 AM

    Within the API, can we get the unique field name to be returned?

    This Submission request example posted on your website:

    curl -X GET "https://api.jotform.com/submission/{submissionID}?apiKey={apiKey}"

    Returns:

    { "responseCode": 200, "message": "success", "content": [{ "id": "237955080346633702", "form_id": "31751954731962", "ip": "123.123.123.123", "created_at": "2013-06-25 03:38:00", "updated_at": "2013-06-27 04:58:00", "status": "ACTIVE", "new": "1", "answers": { "3": { "text": "Name", "type":"control_fullname", "answer": { "first": "Bart", "last": "Simpson" }, "prettyFormat": "Bart Simpson" }, "4": { "text": "Your Message", "type": "control_textarea", "answer":"My father is choking me. Please help." } }], "limit-left": 9991 }


    Within "answers": {} It would make sense to return the unique name also.

    Hope that helps a little more?

    Cheers,

    Andrew

  • Profile Image
    HospiceUK
    Answered on October 10, 2017 at 04:31 AM

    The JSON didn't format very well, apologies. At the moment, per field you receive the properties "text"; "type"; "answer"; "prettyFormat". It would be amazing if we could also get "uniqueName" as defined within the form builder. Cheers.

  • Profile Image
    Jim_R
    Answered on October 10, 2017 at 05:53 AM

    You can get the Unique Names of each field within the form by using this URL:

    https://api.jotform.com/form/{formID}/questions?apikey={apiKey}

    Where:

    {formID} = ID of the form

    {apiKey} = your API key

    Look for the "name" on the JSON result like so:

    API documentation: https://api.jotform.com/docs/#form-id-questions 

  • Profile Image
    HospiceUK
    Answered on October 10, 2017 at 06:13 AM

    That's great, thanks for this - surprised it's not against the answer too! A

  • Profile Image
    HealthEngine
    Answered on October 17, 2017 at 12:01 AM

    Thanks Jim_R, but I cannot see why you would use field id "12" instead of its unique name in GET /submission/{id}.

    I would imagine that for me to get this to work for a very long form, I would get all fields from GET /form/{id}/questions, then iterate through that to locate the unique name for a field that I am after, and find its corresponding field id that way. Then I would use that to find its key value from GET /submission/{id}, and get the answer that way. This seems unnecessarily convoluted, but still more reliable than trying to figure out what answer "12" represents.

    Am I going about this the right way, and is there any plans to introduce the unique name in the submission's get?

  • Profile Image
    Nik_C
    Answered on October 17, 2017 at 02:17 AM

    I'm afraid that that goes outside of our scope so it would be best if you could address the inquiry to our colleagues from API support at api@jotform.com since they have more information and knowledge about the topic.

    Thank you for your understanding.

  • Profile Image
    HealthEngine
    Answered on October 17, 2017 at 03:39 AM

    Will do, thanks Nik_C.

  • Profile Image
    HealthEngine
    Answered on October 18, 2017 at 09:15 PM

    I want to say how impressed I am with your customer support from Hasan S. Within hours of raising an API query via email, he notified me of a change to the submission's get with the added unique name to the results. I can work with this and I no longer need a second call just to get that.

    "answers": { "4": { "name": "practiceName", "text": "Practice Name", "type": "control_textbox", "answer": "Acacia GP" },
    }

    Did not expect this response for a free customer, but I have no doubt that once my prototype is proven to work, an account upgrade is definitely forthcoming. Well done!

  • Profile Image
    John_Benson
    Answered on October 18, 2017 at 11:03 PM

    Thank you for your compliments.

    We are happy to hear that you are satisfied with JotForm services. We strive hard to give our users the best services as much as possible.

    If you need anything else, don't hesitate to contact us again.

  • Profile Image
    HospiceUK
    Answered on October 19, 2017 at 03:21 AM

    This is great, many thanks.

    And - thanks for not changing the answer ID (sorry HealthEngine)!

    This is going to make life a lot easier.

    A