Info | ||
---|---|---|
| ||
This routine is available starting with Power Scripts™ for Confluence v1.1.0. |
Syntax
setPersistentVar(pageId, varName, value) // set page persistent variable
setPersistentVar(varName, value)
// set global
persistent variable
Description
Excerpt |
---|
Sets the specified persistent variable as a string. |
Parameters
...
Parameter name
...
Type
...
Required
...
Description
...
pageId
...
Return type
boolean (true/false)
Returns true if persistent variable value was set successfully, returns false otherwise.
Examples
Example 1
This example assigns value 0 to a page persistent variable named "pageViews". If the variable doesn't exist it will be created.
Code Block |
---|
const string varName = "pageViews";
const number pageId = getPage("TEST", "Example Page");
setPersistentVar(pageId, varName, 0); // a number will be converted to a string |
Example 2
This example assigns value 100 to a global persistent variable named "globalCounter". If the variable doesn't exist it will be created.
Code Block | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Table plus | ||||||||||||
| ||||||||||||
|
Description
Excerpt | ||
---|---|---|
| ||
Sets the persistent var, as a string |
Sets the persistent var, as a string
Parameters
Table plus | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||
|
Return Type
None
See also
Filter by label (Content by label) | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|