Hello,
I have a strange problem. I have a function that calculates the average order value after an item is ordered. This has worked well so far, but suddenly this function only writes 0, even if a value greater than 0 was calculated. I once output the function individually using a button in the UI Builder and it often displays a value there. However, this no longer works in the function in the cloud code. Has anything been changed?
Hi @Gerrit_Marttila ,
Can you provide your appID?
Regards,
Bohdan
Oh yeah forgot:
1D587F4E-EAEB-B148-FF91-47B0E1F88F00
1 Like
@Gerrit_Marttila
Use “print” block for the ArticelInBesetlung table where clause value to display it.
Then try that where clause in the data section “where clause search” with “SQL Search” toggle as checked. Is that where clause work as expected?
Regards
The problem is that the value is actually output correctly. So “Get Property Durchschnitt” outputs the correct average value if, for example, I wrap the function in a button in the UI Builder and output the value there. However, with a bulk update it saves a 0 into the database.
It used to work, but now the 0 thing has been noticed.
@Gerrit_Marttila
You have a lot of ui-builder page. It is hard to find the logic place. Tell us the ui-builder page and path to the logic. Can we play with it? Or you can create a simple page or button component with same logic example.
Regards
I Have a TryAndError Page for Testing and it’s the button with the label “BestellmengenDurchschnitt”. There is a loop in which I evaluate and output the last entries.
And yes you can play with it, this page is only for testing.
@Gerrit_Marttila
At first glance, it looks like you don’t have the “tempItem” variable. Is it ok?
Have you adjusted anything? As a test, I activated the timer again and now it writes the correct values into the field in the database again and no more 0.
Hi @Gerrit_Marttila ,
Does your logic work as expected now or you still need some assistance?
Regards, Andriy