An Example of How The Expression Editor Needs Enhancing

So I’m trying to do some financial maths on the Server Side…

and I’m up against two issues:

  1. I cannot round to 2 decimal places as financial maths requires.
  2. There appears no way to have brackets to make things happen in the right order.

So my example I want to create is this:

{{ ($_POST.amount_payment_local.toNumber() / exchange_rate).round(2) }}

But without the rounding I need to do this:

{{ ($_POST.amount_payment_local.toNumber() / exchange_rate * 100).round() / 100}}

But when I create it in the menu system I get this:

{{$_POST.amount_payment_local.toNumber() / exchange_rate * 100.round() / 100}}

So of course, I can work around it all… but for Wappler to be easy and intuitive, this is an example of where enhancements are needed! :slight_smile:

I’m not quite sure what the feature request is - but I probably want to vote for it.

I think the expression editor in both Server and App Connect is less useable than before. I think the enhancement needed is to allow us to edit expressions directly, or to create them visually - or a mixture of the two.

One of the reasons the new approach was taken was to help people create syntactically correct expressions. However in some cases it makes it more difficult to create valid expressions. It’s a rather serious flaw that software which deals with code puts obstacles in the way of features such as copy/pasting code (something which was not a problem before).

Hopefully it’s on the list of things to fix and improve, but there have been quite a few new features recently which have probably caused focus to be lost from some fundamental issues.

2 Likes

It was good to read your perspectives Tom!

Yes, it is a bit of a strange request… I’ve posted a few other things about re-vamping what is basically a formatting editor to be an expression editor… and when I find things that don’t work out then I post them here so the team are aware of them!

I think you’ll be one happy person on Thursday afternoon :slight_smile:

5 Likes

Great! (But I’m always happy on Thursday afternoons - well, almost always :slightly_smiling_face: )

1 Like

Hi @TomD
Please take a look at the enhancements added to the expression builder in Wappler 3.0 beta 1 :slight_smile:
Let us know what do you think!

1 Like

Hi @Teodor
Great - I think this is an excellent solution: options to create expressions as code or visually. For anyone who hasn’t seen this yet:
You can get an idea of the amount of clicking required to create this expression from the size of the scroll button:

image

However, now the expression can be entered manually, or pasted from somewhere else using this option:

image

Resizing the code view area would be a nice enhancement - but hardly critical.

I haven’t really tried the new Query Builder design. The initial impression was surprise and some confusion, eg:

… but perhaps it’s clearer now. I can’t quite visualise what it looked like before.