I want to make an app that someone can use to order products. e.g. from a restaurant to be able to order something to eat and the order to be sent to the restaurant e.g. by email and that he sends everything he has ordered along with the total cost of the order. 
I started something, but trying it gives me an error, and the email does not include the order in its cost.
Order.aia  (4.2 KB)
             
            
               
               
               
            
            
                 
                 
              
           
          
            
            
              you can use this extension to send email:
  
  
     1.Introduction
Description: With this extension, you can send emails using SMTP servers 
Latest Version: 1.5 
Released: 2020-12-30T18:30:00Z (UTC) 
Last Updated: 2023-07-02T18:30:00Z (UTC) 
 2.Blocks
[image] 
[image] 
 3.Usages
You can use the extension in this way: 
[image] 
And here is a brief documentation: 
protocol ~ either TLS or SSL 
server ~ string 
port ~ int 
user ~ string 
password ~ string 
from ~ string (can be different from username) 
recipients ~ list 
ccRecipients ~ list (can be e…
   
 
             
            
               
               
              1 Like 
            
            
                 
                 
              
           
          
            
            
              The emailing thing is solved, but when I put an amount on the order it gives this error. 
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                Ramon  
                
               
               
              
                  
                    February 28, 2024, 10:56am
                   
                   
              6 
               
             
            
              Because you are multiplying the p's and q's every time you change one...if you change q1, you also multiply 2 and 3...even if they are empty..
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                Ramon  
                
               
               
              
                  
                    February 28, 2024, 11:05am
                   
                   
              8 
               
             
            
              Do you understand the problem? why and where it is generated?
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                Ramon  
                
               
               
                 
              
                  
                    February 28, 2024, 11:09am
                   
                   
              10 
               
             
            
              When you modify "q1" (and q2 / q3 are empty):
you call to the procedure "computSum", where you are also multiplying q2 and q3, which are empty: 
that is the error...
the same occurs when you change q2 (and q3 is empty).
             
            
               
               
               
            
            
                 
                 
              
           
          
            
            
              But shouldn't they be empty, so that the customer can place the quantity he wants?
             
            
               
               
               
            
            
                 
                 
              
           
          
            
            
              So add appropriate protection in the form of conditions so that multiplication does not occur when the text box is empty.
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                Ramon  
                
               
               
              
                  
                    February 28, 2024, 11:32am
                   
                   
              13 
               
             
            
              Yes...the error is not the empty fields...the error is to try to multiply an empty tag...like Patryk says protect those operations to be executed only if there is a value.
             
            
               
               
               
            
            
                 
                 
              
           
          
            
            
              What does protection mean in this case, I make some changes to the blocks and the problem persists
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                Taifun  
                
               
               
              
                  
                    February 28, 2024, 12:12pm
                   
                   
              15 
               
             
            
              
This is also called data validation 
Before doing a multiplication you have to check, if both values are not empty
If is empty a 
Then display 'please provide a value for a' 
Else if is empty b 
Then display 'please provide a value for b' 
Else do the calculation
Taifun
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                Ramon  
                
               
               
              
                  
                    February 28, 2024, 12:31pm
                   
                   
              17 
               
             
            
              How would you multiply p1 x q1, only  if both fields are not empty? Write it here in natural language.
(well, Taifun has done it before...)
Try to "write" it with the blocks.
How do you write this with blocks? 
"If is empty a"
             
            
               
               
              1 Like 
            
            
                 
                 
              
           
          
            
              
                Taifun  
                
               
               
              
                  
                    February 28, 2024, 12:31pm
                   
                   
              18 
               
             
            
              
You do not know how to use an If statement as shown earlier?
Taifun
             
            
               
               
              1 Like 
            
            
                 
                 
              
           
          
            
              
                ABG  
                
               
               
                 
              
                  
                    February 28, 2024,  2:16pm
                   
                   
              19 
               
             
            
              This NZ value function turns blanks into zeroes, to make it easier to do math with blanks: 
             
            
               
               
               
            
            
                 
                 
              
           
          
            
              
                ABG  
                
               
               
              
                  
                    February 28, 2024,  4:29pm
                   
                   
              22