#What are the available functions to interact with the typebot enviroment in the Script Block

1 messages · Page 1 of 1 (latest)

hearty schooner
#

I saw in the documentation the setVariable function in the script block, are there any other functions to retrieve data from the enviroment? because i want to pull data in the script like 'Moment of the day' inside the script block

shrewd nimbus
#

Someone will reply to you shortly. In the meantime, this might help:

-# This post was marked as solved by Baptiste. View answer.

swift crater
# hearty schooner I saw in the documentation the setVariable function in the script block, are the...

There are 2 ways you can achieve this:

  1. Use a Set variable block with the Moment of the day option, and use that variable inside of your Script block. (Easiest method)
  2. Use a Script block to calculate the moment of the day in JavaScript directly. It's tedious and quite useless if you seek the same result as what returns Moment of the day in Set variable, but if you need something more custom, then this is the way. (Harder method)
hearty schooner
#

What i was asking is if I can pull the moment of the day variable inside the script block, the equivalent of a 'getVariable' function in the script block, because there is no documentation about how to access System variables besides the set variable block

swift crater
#

Mhm, I understood that, and if you first saved System variables like Moment of the day in a Typebot variable, you can access it in a Script block using {{variable_name}}