Total price is always $0 even though it works according to Test

Hi, my price calculations are not working properly. Here are three problems:

(1) The Bestellpreis $0.00 is the total price of the two orders customization_frontend and customization_functionality. It should add those two numbers (which it does according to the Test of the formula), but for some reason only 0$ is displayed.

The formula of total price looks for the prices in the Form table and takes all the products of this rows’ Quote_ID:
SUM ( SELECT (Form[Price], [Quote_ID] = [_THISROW].[Quote_ID]))

(2) When I create a form that calculates the price according to the package and the chosen size (both per dropdown), the price ($67.2000) is not calculated real time, only after I hit save. Is there a way to make the price change real time depending on what I choose from my dropdown list?

(3) I have a virtual column and a data set column. Both calculate the current price of a product by multiplying two values that I look up in other tables. Both have this formula:
[Workdays] * [Daily_Rate]
For some reason, only the virtual price calculates the correct price. Real price always stays $0, even though the Test in the formula works.
I thought it might be because virtual columns get compiled last and therefore have all the values they need, whereas real columns calculate while other columns are caluclated and therefore use $0 even though it is 100$. Can you schedule column expressions so that certain expressions are compiled last?

All of these problems are part of the same category, that’s why I put them together.

If you need information to be able to answer this question let me know.

Thank you!

I assume you have placed this expression into the App Formula of the Total column - which is a"normal" table column not a Virtual Column?

The package data is in a different table than your Total value is. If you change one of the package rows, you have to do something in the app to signal that you want the Total updated as well.

Since you indicated you wanted a real-time update, you need to handle the update on the device side. You are making the changes to the package rows, it appears, from the Table in the Detail view. SO…you really only have once choice…

…Add an action to the Form Save behavior of your Package Form view - where you are making the change. This action will “touch” the row that has the Total value triggering its update.

To do this, you will need 2 actions:

  • First action is of type, “execute an action on a set of rows”, identifies the parent row needing the Total updated and then calls the second action.
  • Second action makes an edit on that parent row to trigger the App Formulas. Sometimes you don’t have a column that you can just apply an update to. In these cases I will add an “Edit Count” column and simply increase it by 1 each time. This at least gives me other information such as how many times the Total was updated.

Then in your Packages_Form, insert the first action into the Form Saved behavior setting. See image.

I hope this helps! This is very general, so please ask questions!

1 Like

Hey WillowMobileSys,
thank you very much for your quick reply!

So you are saying because my Form table where user input values use references from other columns to calculate the price, the total price does not change in real time when changing options from my drop down, right?
I’m just wondering, because I have a different drop down menu where people can choose a person to work with. And when I change the person in the dropdown, the wage column of that person is changing as well and I don’t even have to hit save. It just changes with the drop down value itself. Isn’t there a way to make it work like this?

Anyway, I’m trying to implement your solution.
I need two actions.

Here is my save action:

And my trigger for the save action:

In the trigger action, I want to set the values of my Edit_Count column to _THIS + 1, but under “Set these columns”, the column doesn’t even appear.
How should the 2nd action look like?
And is the first one correct?

Your help is much appreciated!

I think, correct? My understanding is that when in the view on the original post, you select one of the Package rows or even tap “Add” to add a new one and the Total Value does not update.

The main issue is that you accessing the Package rows directly for editing.

If you were to edit the Package rows from the Parent Form, I think you would see the Total column automatically update in that use case.

What I mean is, open the row that holds the Total column in a Form View (instead of a Detail View) and also show the Package Child rows - likely as an Inline Table very much like what you are seeing in the Detail View.

This does require setting up the Parent/Child relationship using the “Is part of” property. (I can help setup if you show your tables).

When you access, the Package rows in this manner, edit them (or add a new one) and return to the Parent Form, the Parent row will automatically perform an update triggering any App Formulas.

1 Like

How would you set up the tables as a Parent-Child-Relationship?
Here are the important tables.

Quote (read and write)



Quote_ID



Customer_ID



Customer_Name



Quote_Create_Date



Quote_Price



59921669



11595965



Zulu01



06.10.2023



12600



ac076c9a



5ccaabd4



Zulu02



06.10.2023



4000

Form (read and write)



Form_ID



Quote_ID



Package_ID



Package_Name



Size_Value



Daily_Rate



Package_Workdays



Price



765df547



59921669



7

Customization

7



400



5

2000


7f30e940



59921669



16

Functionality

16



800



9

7200


f0d212ff



59921669



2



Business



2



800



4



3200



3fbeb637



ac076c9a



1



Business



1



800



2



1600



8b3ade2e



ac076c9a



3



Customization



3



800



1



800



dc090918



ac076c9a



9



Functionality



9



800



2



1600

Packages (read only)



Package_ID



Package_Name



Size_Value



Package_Workdays



1



Business



S



2



2



Business



M



4



3



Customization



S



1



4



Customization



M



2



5



Customization



L



3



6



Customization



XL



4



7



Customization



XXL



5



8



Functionality



O



1



9



Functionality



XXS



2



10



Functionality



XS



3



11



Functionality



S



4



12



Functionality



M



5



13



Functionality



L



6



14



Functionality



XL



7



15



Functionality



XXL



8



16



Functionality



XXXL



9

Customer Zulu02 wants to create a Quote, similiar to a shopping cart, in which he can add products.
He creates Quote ac076c9a in the Quote table.

In Quote ac076c9a, he adds three products (1,3,9) from the Package table and chooses a size for each of them.

Now, each product has its individual price, which is: Product_Price = Package_Workdays * Daily_Rate.

Each Quote is the sum of all Product_Prices it contains.