Jump to content

- Usage

- # Persistent Variables - 3.3 - Retrieve a value

  Followers 0

  VBScript

  Retrieving a persistent variable like storing it very straight forward, just like common VBScript variables.

  The only difference is, that the value you read from the variable will be taken from the database in that moment.

      Dim Announcement
      Set Announcement     = new PersistentVariable
      Announcement.Name    = "Welcome"
      Announcement.Default = "Beep.wav"

      PlaySound Announcement.Value

  Before you read the content from the persistent variable you should define a Default value. This value will be returned in case nothing has been stored previously into the persistent variable.

  Reading content from a persistent variable is the same as you would use a common variable, just that you have to read the Value property.

  The above code passes the content of the persistent variable as parameter into the PlaySound function (build-in function of the Call Routing Manager, is used by "Play Announcement" action of Rule Assistent).

  You can also access the variable directly in nearly any of the GSE blocks:

  If the above code is used in a call routing of a user, the variable will be visible/accessible for the current script user only (the User scope is the default scope in this case).

  If the above code is used in a call routing of a group, the variable will be visible/accessible for the current script group only (the Group scope is the default scope) in this case.

  To configure another scope you have to change the Scope property.

  You will find the 3.5 - Simple Script - Retrieve Variable in the download package which includes the above code (except line 6).

  By Tom Wellige

  - May 14, 2022
  Share
  Share
  Followers 0
  Previous Page 3.2 - Store a value
  Next Page 3.4 - Simple Script - Store Variable

## Important Information

By using this site, you agree to our Terms of Use and have taken note of our Privacy Policy.
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.