--- title: "Variables" slug: "composer-variables" updated: 2024-06-13T13:29:17Z published: 2024-06-13T13:29:17Z canonical: "support.dise.com/composer-variables" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.dise.com/llms.txt > Use this file to discover all available pages before exploring further. # Variables Variables has a name, value and type. Name of a variable should not contain a space and should be shorter than 256 characters. Even if most applications will handle both spaces and longer names. Value is always a string. And the type is default text/plain if no other is selected. The value is in Unicode and not limited to a specific length. --- ## Movie Variables In the composer it is possible to add variables of different types to the Movie. These variables will be available for the playback when playing this movie. The scope of these variables is Local (Dise Movie Context). Any file (image, video, binary) that is connected to the variable will be uploaded as a dependency and accessible as a data connection or through a script. ### Template fields Variables in the Movie can be promoted into template fields, which allows the Composer to upload them to the portal and add the variable as a template field. Not all types can be used as template fields and the portal will handle types that are connected to a file differently from those that are not. The Template and Template Fields will be converted into [Messages and Message Fields](/docs/messages) in the Portal and those will then be published in a playlist to the player. ### **Template vs Message** A template is created by the Composer when uploading a Dise Movie to the portal that has one or more variables marked as a template field. Each template field will have the following properties - Name - Type (see below) - Value (can be empty but usually something, read only) - Required A message is created by the Portal and is connected to a template. It has fields corresponding to the template fields. But if the template has been changed after the message was created there can be difference between the two (like fields changed, removed or added). The message can be added into a playlist. The message has these properties - Name - Type - Value ### **Publishing & Playback** A message is published in the playlist that they are attached in (they can be attached to more than one). The player will get the name, type, value of the message field. The template field value will not be sent to the player. When the message field is received by the Player it will put that into the variables for the Movie, replacing (on name) any variables that was created for the movie (see above). Types --- ## Object position (Relative) **Mediatype** application/x-ds-object-position-relative **Data** Semicolon separated pixel position *x;y* Relative to the position where the object was created. **Example** "0;0" (no change) "1000:0" (+1000 pixels on the x-axis) "0:1000" (+1000 pixels on the y-axis) "0:-1000" (-1000 pixels on the y-axis) --- ## Object color The color of the object, only for objects with color (like text, shape, ticker, …) **Mediatype** application/x-ds-object-color **Data** Color value in hex "#RRGGBB" **Example** "FF0000" (red) --- ## Object visible **Mediatype** application/x-ds-object-visible **Data** "true" om the object should show, false if it should not show. **Example** "true" (shows) "false" (does not show) --- ## Image file **Mediatype** image/* **Data** Filename (full or relative path) or hash of file. **Example** "C:\DiseContent\image.jpg" "0206205f41452687c772749b28f0bbabbaf9893c" --- ## Video file **Mediatype** video/* **Data** Filename (full or relative path) or hash of file. **Example** "C:\DiseContent\video.mp4" "03ea55d42903c041b1ff64c2bd593fb7b9d3a843" --- ## Binary file NoteWill not be promoted as a template field **Mediatype** **application/octet-stream** **Data** Filename (full or relative path) or hash of file. **Example** "C:\DiseContent\info.json" "f39d30498126f724d70107c737f023c5de071e8e" --- ## Text **Mediatype** The text in the object, only for objects with text(like text, paragraph, web page, …) **Data** String of text **Example** "This is my text in my field" "https://dise.com" --- ## Object alpha **Mediatype** Alpha level of object **Data** Percentage of alpha level (0,20 = 30%) **Example** "0,20" "0,50" --- ## Using variables Variables can be read or created using these methods. Message Field [Composer, Premium Player, Lite Player, CX Portal] If a Message is connected to the template playing on the player, then all message fields will be added as Variables to the Movie and are then accessible to all other methods listed here. ### **Script [Composer, Premium Player]** ```python variabel = DISEScript.GetVariable("name") variabel = DISEScript.GetVariable("local", "name") variabel = DISEScript.GetVariable("global", "name") DISEScript.SetVariable("name", "value") DISEScript.SetVariable("local", "name", "value") DISEScript.SetVariable("global" "name", "value") ``` Without scope the variable will first be found in local scope and then in the global ### Connect Property [Composer] In the Composer we can connect a variable to a Property of a Object (image, video, text, …). This works for all types above (position, color, visible). Scope: First local scope and then global. ### Data connection [Composer] Used by “Connect Property” but can also be used for most objects to change the text or filename. Scope: First local scope and then global. ### Player Custom Setting VAR-x [Premium Player, Lite Player, Portal] Added on player or player group in Portal. [Custom settings](/docs/custom-settings) ### HTTP API [Premium Player] Scope: Global [API](/docs/api) ### Variable editor [Premium Player] Scope: Global How: - In Premium press F5 and choose *Debug > Variable editor (Need to turn on debugging, see custom settings 'debug' setting)* - In Composer choose *File > Debug > Global variables* - Then choose *Add* to add or double click on already created variables to edit them. ### Playback monitor [Premium Player] Only view Scope: Movie context ### Web pages / Widget [Lite player] When adding a web page to a playlist and playing on Lite player any variables on the player will automatically be added to the end of the URL as query parameters. #### Scope Variables can be global or connected to a Dise Movie Context (Local) Global variables are only available through the application, so they are not shared by default between the Control center and Replay or between the Portal and he Control center. There is a setting called "VariableDefaultScope" that you can set to "local" to force the player to check local variables when nothing is speciefied, you can also set it to "global" if you want to ignore local variables when nothing is specified (Backward compability). Set variables - From the Portal - How: Create a custom setting (string) on a player/group that for example is called Var-X. This will set a variable on the Player that is called 'X'. - Scope: Global - From script - How: In a script, run: - DISEScript.SetVariable("name", u"BOB") - DISEScript.SetVariable("global", "name", u"BOB") - DISEScript.SetVariable("local", "name", u"BOB") ### Python Scope: - Dise Movies where the variable and script is defined if nothing else has been specified. - Global for background scripts ### From the players HTTP api How: - Make sure the webserver is active on the player (See network in this guide [Custom Settings](/docs/custom-settings)) - Find the players API-GUID Example curl -H "Content-Type:text/xml" -X PUT --data " Persistent='false'>Value" http://localhost:8080/api/Replay/API-GUID/Variables/Variablename Full documentation here: [HTTP API](http://developer.dise.com/Premium%20HTTP%20Api%202022-06-28.pdf) ### From event How: - Right click the object or scene and pick *Events* - Choose for example *When scene starts* and click *Add.* - Choose "Set variable" in the list and write name and value below.    Scope:  - Dise movie context (default in new versions) or Global (Automaticly created before v27)  - There is a choice to either use Global or Local variables ### During scene or object runtime How: - Right click on the object or scene and pick *Events* - Click *Add* under *Variables set during playback*    Scope:  - Dise movie context (default in new versions) or Global (Automaticly created before v27)  - There is a choice to either use Global or Local variables ### From variable editor & "preview" context editor How: - In Composer choose *Movie > Edit variables* - Click *Add* to add a variable. - Choose *Movie > Edit contexts* - Click *Add* to add a context - Choose a variable by either hitting F2 or by clicking in the Value-column to change a predefined variable.    Scope:  - The current Dise movie context, only works in Composer. ## Automatically created variable names ### On premium player - PlayerId - The id of the player - PlayerName - Name of the player ### Location - BrandId - the display's brand id - BrandName - the display's brand name - CountryId - the display's country id - CountryCode - the display's country code - RegionId - the display's region id - RegionName - the display's region name - SiteId - the display's site id - SiteName - the display's site name - SiteLatitude - the geographical latitude value for this display's site - SiteLongitude - the geographical longitude value for this display's site - SiteAddress - the display's site address - AreaId - the display's area id - AreaName - the display's area name ### Tag - - for each tag on the display, a corresponding variable is created ### Operating hours - Operating_hours.exceptions - The operating hour exceptions set - Operating_hours. - Operating hours for a specific day - use_operating_hours - If it will use set operating hours or not ### Playback statistics - Playback_statistics.intervall - Intervall of time for when the player will send playback statistics - use_playback_statistics - If the player will use playback statistics or not ## Related - [Create a Template](/create-a-template.md) - [Object Overview](/object-overview.md)