Dubious transformation of set Variable in Server Action

Wappler Version : 3.9.7
Operating System : Windows10 Pro 20HD
Server Model: PHP
Database Type: MySQL
Hosting Type: Shared (HostEurope)

###Background
I want to increment database field by one.

###Steps to reproduce

  1. Add Database Single Query to get information.
  2. Set Value: Using lightning sign select field of single query
  3. Using wand select ‘Operation’ with ‘+’ and Value “1”
  4. Save and insert Database Update query to update field with incremented number

Expected behavior

The by one increased number is written to the respective database field.

Actual behavior

After having clicked save in the Set Value Value Window the generated code {{getcurrenthighscore.highscore.toNumber() + 1}} gets transformed into {{getcurrenthighscore.highscore.toNumber()}}1 whereby not adding but just adjoining the number 1 to the preexistent number.

Just enclose your expression in braces to indicate it has to be done together And that is is not a template expression.

1 Like

OK. Thanks for clearing that up. So correct code would be:

({{getcurrenthighscore.highscore.toNumber() + 1}})

No braces need to be inside the {{ and }} so just around your expression

1 Like

The issue is with the picker UI. The manual work-around of writing the expression works, but only in the properties panel or in the file directly.

If I write the expression in design or code tab of picker, it changes the +1 to be part of string instead of a mathematical operation.

Yeah, I played around with it a lot more, and I got to admit. The current way doesn’t make much sense. If you have to manually alter all such mathematical operations, why have the picker at all?
If I pick a variable, write a plus and pick the next variable 9 out of 10 people (at least) would want to add those to variables.

Writing plus is treated as a string. But when you select it from wand/formatter UI as an operation, then it treats as an addition calculation.
Right now, its a bit messed up.