Skip to content

Setting custom variables

Julian Waller edited this page Oct 14, 2023 · 4 revisions

This is an experimental idea, that may be removed without notice

Sometimes, an action can produce a bit of data that the user may want to do something with. In these cases, it doesn't make sense to write it to a variable from your module, as another action on the same button could overwrite it too soon.

Instead, you can output to a custom-variable. To do so, you can add an input field of type 'custom-variable'. The options to this are automatically populated for you.

Then inside your action callback, you can do a call like this.setCustomVariableValue(action.options.result, 'Your value') to set the value.
Note: If the variable id is not valid you will not be informed.

Some additional rules around this:

  • Remember that these variables are owned by the user. You should only change them when asked.
  • This must be opt-in by the user. The input field will default to 'None', and you must respect that
  • You must not set the value of any custom variables at times other than the result of an action
  • You must not attempt to discover the custom variables in any way other than the value of this input field.
Clone this wiki locally