Assigning id to dropdown values

  • Profile Image
    nkrupa
    Asked on December 27, 2021 at 06:21 PM

    I've read multiple threads on this, including https://www.jotform.com/answers/1500195-form-create-an-identifier-for-a-selected-option and https://www.jotform.com/answers/2607265-how-can-i-set-option-labels-and-values-independently-in-a-dropdown-field.

    However, I have over 5,000 ID|Value values that I need to add into a dropdown selection. For example:

    ID|Value
    1|Value1
    2|Value2
    3|Value3

    I can't possibly map 5,000 values as described here https://www.jotform.com/help/301-how-to-assign-calculation-value/. I only want the values displayed in the drop-down and the corresponding ID copied to an integer field.

    I am open to having a list of values such as "Value1 [1]" and RegEx to extract the [1]

    Bonus points if this is possible with https://www.jotform.com/widgets/autocomp

  • Profile Image
    Lorenz_A
    Answered on December 27, 2021 at 09:57 PM

    Hi there,

    Unfortunately, the guide here  https://www.jotform.com/help/301-how-to-assign-calculation-value/ is the only way in assigning value to dropdown options.

    Could you please provide us more details about your requirement, we forward it to our devs instead as a feature request.

    We will wait for your response.

  • Profile Image
    nkrupa
    Answered on January 01, 2022 at 09:44 PM

    The requirements are simple; have a list such as

    ID|Value
    1|Value1
    2|Value2
    3|Value3
    ...
    5000|Value5000

    And a dropdown form should be able to emulate the HTML <option> without having to create 5,000 calculation mappings.

    <option value="5000">Value5000</option>

    Ideally, either the dropdown allows for a copy-paste of a list with a delimiter or allows for a spreadsheet to be dropped as with other widgets.

  • Profile Image
    Kenneth_C
    Answered on January 02, 2022 at 03:18 AM

    Hi there,

    As inject scripts are not possible with form, you can do so by downloading the Full source code of the form, and inserting your codes that would accomplish your requirements.

    Here is the related guide: https://www.jotform.com/help/104-how-to-get-the-full-source-code-of-your-form/.

    Best.