Need to parse a string that is the value of a drop down.

  • JonesTimothyTjones
    Asked on July 14, 2025 at 3:53 PM

    I have a form that I am updating the values of the drop downs from an api. I need to be able to parse the string or value of the drop down to make logical decisions based on the values in the single string of the drop down value... For example,

    1. I need to calculate a total from multiple fields
    2. I need to be able to warn the user if they make a choice in a drop down that is not compatible with another choice from another dropdown.

    The strings in the drop down1:

    Black 2021 Apple iPad Mini Wi-Fi 256GB - Space Gray 6th Generation - $449.01 - Available: 0

    White 2021 Apple iPad Mini Wi-Fi 256GB - Space Gray 6th Generation - $449.01 - Available: 0

    The string in the drop down2:

    Black Printer - $123.01 - Available: 0

    White Printer - $123.01 - Available: 0

    Total text field:

    sum of the 2 sections

    So.. I need to calculate the total of the 2 sections (I know I can use the calc value option but this then takes away the text value ) and I need to warn the user if the select a black option from dropdown 1 and a white option from dropdown 2.


    I cannot figure out a way to take the value from the dropdown (or text field) and parse the value so I can look at "black" or "white" and get the $$$ price individually... Please help

  • Christian Enterprise Support
    Replied on July 14, 2025 at 4:55 PM

    Hi Timothy,

    Thanks for reaching out to Jotform Support. I understand you're updating your dropdowns through an API, and you're trying to pull out specific details like the color or price from the selected value. You also want to calculate a total based on those selections and show a warning if the choices from the two dropdowns don’t match, like picking Black from one and White from the other.

    Let me look into it and get back to you with a solution.

    Thanks for your patience while I checked into this.

  • JonesTimothyTjones
    Replied on July 14, 2025 at 5:17 PM

    if only the calculate widget had string functions like left, right, mid or parsing of comma delimited fields we would be golden!!!!

  • Christian Enterprise Support
    Replied on July 14, 2025 at 6:10 PM

    Hi Timothy,

    Thanks for patiently waiting. Currently, there’s no built-in way in Jotform to extract specific parts of a dropdown option — like pulling out just the color or price from a longer string. This is because Jotform treats the entire dropdown value as a single chunk of text, and it doesn’t have native support for more advanced text parsing, like splitting or filtering parts of a string directly within conditions or calculations. So, for example, if you have a dropdown item like:

    “Black 2021 Apple iPad Mini Wi-Fi 256GB - $449.01 - Available: 0”

    Jotform can’t automatically separate that into just “Black” or “$449.01” unless we set that up manually.

    That said, I found a workaround that can help you achieve a similar outcome using Update/Calculate Field conditions. Here’s how we can set this up step-by-step using a clone version of your form:

    Since you already have the Terminal Configuration Text and Terminal Printer Text fields added, we’ll use those as our target fields for extracted values.

    Create Update/Calculate Field Conditions:

    1. In the Form Builder, then click on Settings at the top.
    2. On the left panel, select Conditions.
    3. Click Add a new condition, then choose Update/Calculate Field.
    4. Now let’s create a sample condition like this:
    • IF: Terminal Configuration
    • STATE: Is Equal To
    • VALUE: Black - 2021 Apple iPad Mini Wi-Fi 256GB - Space Gray 6th Generation - $449.01 - Available: 0
    • DO: Calculate a Field’s Value
    • SUMMARY: Insert the text “Black” into Terminal Configuration Text

    Need to parse a string that is the value of a drop down Screenshot 80

    Note: You’ll do the same kind of condition for each dropdown option to extract the needed parts (like "White" for white options).

    Now that we have the color stored in those short text fields, let’s set up a Show/Hide Field condition to trigger a warning if the selected values conflict. Create a condition like this:

    Counter Condition 1:

    • IF Terminal Printer Text Contains "White"
    • AND Terminal Configuration Text Is Equal To "Black"
    • DO Show Paragraph field (warning message)

    Need to parse a string that is the value of a drop down Screenshot 91

    Counter Condition 2/Do the opposite:

    • IF Terminal Printer Text Contains “Black”
    • AND Terminal Configuration Text Is Equal To “White”
    • Then Show the warning message.

    Need to parse a string that is the value of a drop down Screenshot 102

    This way, the form will display a message when incompatible colors are selected.

    To keep the form clean for your users, you can hide those short text fields that hold the extracted values. To do that:

    1. Hold Ctrl (or Cmd ⌘ on Mac) and select both fields.
    2. A menu will appear at the top right corner; select Hide from the menu.

    Need to parse a string that is the value of a drop down Screenshot 113 Since you already added a Form Calculation widget, let’s make sure it pulls the price values correctly from the dropdowns:

    1. Click the dropdown’s gear icon to open its properties.
    2. Go to the Options tab and scroll down to find Calculation Values.
    3. Toggle it on, then assign a numeric value (e.g., price) for each dropdown item.

    Need to parse a string that is the value of a drop down Screenshot 124 Next, go to the Form Calculation widget:

    1. Click the wand icon to edit it.
    2. In the formula editor, click Add Field, and select the two dropdowns.
    3. Add a plus (+) operator between them, and you can also insert a “$” sign as a string if you want.
    4. Once done, hit Save and you're good to go.

    Need to parse a string that is the value of a drop down Screenshot 135 After setting this up, the form will:

    • Store specific parts (like color) in hidden fields
    • Show a warning when incompatible options are selected
    • Calculate the total price correctly using assigned values

    Check out the screencast below to see my sample results:

    Need to parse a string that is the value of a drop down Screenshot 146 You can try out the updated version on the clone here, or feel free to clone it into your own account to explore the changes more closely.

    Give it a try and let us know if you need any other help.

  • JonesTimothyTjones
    Replied on July 15, 2025 at 4:17 PM

    ok... I was working down this same path. You are 99% there!! The problem with this scenario is that the fields are dynmically updating from the API everyday. This would mean that we would have to continually update the conditions.. I dont see a way to update conditions via the API

  • Manilene JotForm Support
    Replied on July 15, 2025 at 4:49 PM

    Hi Timothy,

    Regarding your question about dynamically updating conditions via API to match dropdown values that change daily: JotForm currently does not support modifying form conditions through the API. All conditional logic must be configured manually within the Form Builder and cannot be updated or managed programmatically.

    This means that even if your dropdown options are being updated daily through an API connection, the related conditional logic in your form will not update automatically. You would need to manually revise those conditions whenever your dropdown values change.

    As a workaround, you might consider restructuring your form to reduce the dependency on frequently updated conditions. For example, using hidden fields, calculation values, or more generalized logic might help streamline your setup but any updates to actual conditional rules still require manual input.

    Reach out again if you have any other questions.

  • JonesTimothyTjones
    Replied on July 16, 2025 at 8:05 AM

    The issue that you run into splitting up into different fields "hidden fields" is that you have to asure they all stay in sync. And... if you use the calc values you can no longer reference the text in dropdowns as values.. There has to be a better way.

  • Arslan JotForm Support
    Replied on July 16, 2025 at 8:43 AM

    Hi Timothy,

    Currently, Jotform does not support updating form conditions through the API, which means any conditional logic tied to dropdown values has to be maintained manually. This limitation makes it difficult to keep conditions in sync with dynamically changing dropdown options.

    So even if your dropdown options are refreshed daily via an API connection, the conditional logic tied to those options won’t automatically adjust. You'll need to manually update the conditions whenever your dropdown choices change.

    Reach out again if you have any other questions.