Passing multiple variables in the same expression


#1

Continuing the discussion from Iterate global variable and question:

I’m trying to figure out how to pass two variables in a expression field.

Example SetVolumeAndSpeak(vol,message)

Setvolumeandspeak({SelectedVolume}, {TextMessage})
Is what I want to pass but when I put it in the expression field like
SelectedVolume, TextMessage I get

Setvolumeandspeak({SelectedVolume, TextMessage})


#2

In an expression box, standard text is usually inside quotes, and the variable names are outside the quotes, with no curly brackets. The quotes can be either single, or double quotes, but stay uniform.

Here is an example using your phrase:
Setvolumeandspeak({SelectedVolume, TextMessage})
and as typed in the expression box:
'Setvolumeandspeak('SelectedVolume', 'TextMessage')'
which returns:
Setvolumeandspeak(40, Text Message)

temp

It helps when you see the translation of the code in real time (grey background) as you type, making it easy to correct any grammatical errors. Often you’ll have to populate the variables once though to see it properly.

Here’s the piston. WebCoRE added curly brackets, but they were not typed in the expression box.

temp


Side note:
If your receiving device requires the curly brackets, use this expression instead:
'Setvolumeandspeak({'SelectedVolume'}, {'TextMessage'})'
which returns:
Setvolumeandspeak({40}, {Text Message})

(notice that everything is inside quotes except for the variables in the expression box)


#3

My Man…, Thank you, I’ve been racking my brain trying to guess it. BTW, someone else helped me also and gave me this which also worked like a charm.