Add two values ​​inside variables TASKER

Skip to first unread message

Genios Marketing

Sep 14, 2022, 1:02:45 PMSep 14
to Tasker
Hello. I have a problem that I cannot add two numbers, can someone help me? The data to sumer comes from WhatsApp. The client writes that he wants a Cake for 309.00 and wants to add a photo of 100.00 I have the data stored in %Price %Photo 
 I want to sum those 2 values, in JavascriptLet. 
var price = parseFloat("%Price"); 
var photo = parseFloat("%Photo"); 
var total = price + photo;
Then I visualize the result in a Flash "hello, price of the cake is %total" 

and the result it shows me is: "hello, price of the cake is nan
I would like someone to guide me and be able to generate the correct result.

best regards

Jay M

Sep 14, 2022, 6:15:28 PMSep 14
Im assuming %Price and %Photo were created in Tasker and not somewhere in the JS? if so they need to be accessed with global()


var price = parseFloat(global("%Price")); 
var photo = parseFloat(global("%Photo")); 
var total = price + photo;
You received this message because you are subscribed to the Google Groups "Tasker" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit
Message has been deleted

Genios Marketing

Sep 15, 2022, 5:14:49 PMSep 15
to Tasker
It saves all the information but it does not calculate the total.
Run the JavaScript Let function as you indicate and it does not generate the result.


Jay M

Sep 15, 2022, 6:24:20 PMSep 15
I cant read the language so im not sure what im looking at. I cant see %Photo in use anywhere, i do see %Foto though so maybe it was just a typo and you were supposed to use %Foto in the JS? 

Anyways i just tested the code i wrote by creating the 2 variables in Tasker and adding them together in the JS  and it works for me see screenshot.

On Thu, 15 Sept 2022, 22:09 Genios Marketing, <> wrote:
It doesn't work for me yet... I send you a screenshot where I save the data, and a field of the tasker function

El miércoles, 14 de septiembre de 2022 a las 16:15:28 UTC-6, Jay M escribió:

Genios Marketing

Sep 16, 2022, 5:18:33 PMSep 16
to Tasker
works when a numeric value is assigned to the variable. But in my case I receive the data from WhatsApp in the variable %message
  •  I receive all the data from WhatsApp, then process and mutresta them in the Variables assigned in Tasker
    • 1. Set the Variable %posicion to position the WhatsApp number that writes to me and not generate conflicts when 2 clients write at the same time
    • 2.   I make use of Si (if) to condition the data that comes from WhatsApp and assign them the variables

    • grafico.png
Reply all
Reply to author
0 new messages