Set() in script of widget

I’m trying to get an understanding of the set() function. I’m trying the following in the value of a button:

JS{{
set(text_1, value)
}}

It doesn’t work however. What am I doing wrong?

Cheers
Søren

The set function is only available in scripts, not in JS{{}} or #{} blocks. Syntax wise, the first argument must be a string : text_1 must be enquoted or previously declared as a variable.

// option 1
var value = 1
set('text_1', value)

// option 2
var value2 = 2
var widgetId = 'text_1'
set(widgetId, value2)

Perfect explanation, you’re the man!!!

Thanks :slight_smile: