Calculating the sum of entity attributes of numeric type

I have one question

I placed a matrix inside a web form and placed the numeric type as an attribute of entity

Next, I want to place a numeric type variable in the web form, calculate the sum of entity, and assign it.

In that case, how do you put the variable in the web form and put the sum

Hey Caos,

If you are looking for something like this to display the total price of a selection of items

You should create a function in the EntitySelection’s class

image

and then create a onload event to call it and bind it to your numeric type variable (dataSource).

PS: don’t forget to recall the function when you apply a search.

this example reminds me that there needs to be some good clarification of the sequence of operations - not in a mathematical sense, but in a form loads and these things happen in this order, because if we’re going to use that sum in some other calculation - let’s say computing sales tax, or delivery, or whatever, we want those follow-on operations to happen after the total is calculated. if that means that our ES needs a private attribute for the total, we probably still want to ensure that it only is computed once for the ES, and then read by all the other functions that use it.
maybe i’m just stuck on qodly being low-code, and the lack of control i have over things like sequence in this environment.

Thank you for your response

Basic functions for representing the state of matrix and data table in Web forms
I think there is a display of the total number of Enntities

Do you just want to get your selection’s length? If that’s the case then you can just bind your datasource with the selectionName.length variable:

image

Thank you

I did a good job with the advice

I’m getting a little used to the respective integrations of Qodly.server.json .css.browser