App Connect Data Formatter Support Product Page

Answered

Converting "Math" Values in Select Form back to "Human Value"

Asked 01 Jul 2025 18:31:04
1
has this question
01 Jul 2025 18:31:04 Bobby Edgar posted:
I have select forms that work for calculations. Each option has a value of "x" that represents the label for that option.

Like: <option value="0.063">1/16in"</option>

Math works great, but I want to save the label to the database instead of the value because it's just for my statistical purposes.

I can create a hidden input and pull the value from the select and use the input for the database, but how do I reverse "engineer" the value?

Like: If select value == '0.063' then input value == '1/16in' || If select value == '0.125' then input value == '1/8in'

Replies

Replied 08 Jul 2025 07:26:10
08 Jul 2025 07:26:10 Teodor Kuduschiev replied:
Hello,
You don't need any hidden inputs for this. Just use the value of the select in the server action and create your conditions there. Add as many conditions as you need for the select value and inside each of them add a variable with the same name, having different value per different conditions: prnt.sc/rNPLleDifY80


Then simply use this variable in the insert step.
Needless to say, tasks like this are a lot easier and you have more advanced control of these in Wappler, which is much more advanced than DW and the extensions inside it.
Replied 09 Jul 2025 12:53:23
09 Jul 2025 12:53:23 Bobby Edgar replied:
Your response is extremely helpful. Thanks a bunch!

Reply to this topic