Updating Core Variables with JavaScript


Basically I want to update one of the Spark.variables over JavaScript. I have a database and a basic html/JS page. What I want to do is that when I click a button in the web page I want change the Spark.variable with the data in database.

I figured out that I can trigger a Spark.function with the button and function will get the data from the database but I’m looking a way to send the data directly to variable when I click button.

What is the best way to do that ?


Hi @tkelestemur

Have you seen this tutorial that uses Spark.function and Spark.variable?

It will show you how to update a variable, servo position this case, using a slider or buttons and then read back that variable.