Skip to product menu

Zoho Analytics has been recognized in the 2025 Gartner® Magic Quadrant™ for ABI Platforms.Read more

Skip to main content

Create Variable

Create a variable in the specified workspace.

REQUEST URI

https://<ZohoAnalytics_Server_URI>/restapi/v2/workspaces/<workspace-id>/variables

Post

oauthscope

QUERY PARAMETERS

 

Parameter Name
Description
CONFIG*JSONObject

Config parameter specifications are available in the below section.

FIELDS FOR CONFIG JSON

KeyDescription
variableName*String

Name of the variable.
variableDatatype*

Integer

Datatype of the variable.

  • 1 - PLAIN
  • 4 - NUMBER
  • 5 - POSITIVE_NUMBER
  • 6 - DECIMAL_NUMBER
  • 7 - CURRENCY
  • 8 - PERCENT
variableType*

Integer

Type of the variable.

  • 0 - LIST
  • 1 - RANGE
  • 3 - ALL_VALUES
formatJSONObject

Variable format.
Refer JSON Structure.
userSpecificDataJSONArray

Array of user specfic values.
Refer JSON Structure.
defaultDataJSONObject

Default value for the variable.
Mandatory for and variable type.
Refer JSON Structure.

FORMAT STRUCTURE

KeyDescription
alignment

String
 

  • Left
  • Center
  • Right
decimalPlacesInteger

-1 to 10
currencySymbolString

<CURRENCY_SYMBOL>
showNegativeSignBoolean

true / false
userLocaleBoolean

true / false
thousandSeparator

Integer
 

  • 0 - NONE
  • 1 - COMMA
  • 2 - DOT
  • 3 - SPACE
  • 4 - SINGLE_QUOTE
decimalSeparator

Integer
 

  • 0 - DOT
  • 1 - COMMA
showPercentBoolean

true / false
Valid only for format type.

USER_SPECIFIC_DATA STRUCTURE

KeyDescription
valuesJSONArray

Array of values
emailIdsJSONArray

Array of EmailIds
defaultValueString

Default value for the variable.
Mandatory for variable type.
minValueString

Minimum value for the variable.
Mandatory for variable type.
maxValueString

Maximum value for the variable.
Mandatory for variable type.
stepSizeString

Incremental value for the variable.
Mandatory for variable type.
domainNameString

Name of the domain
To add variable values to the white label domain users.

DEFAULT_DATA STRUCTURE

KeyDescription
valuesJSONArray

Array of values

Mandatory for variable type.
defaultValueString

Default value for the variable.
Mandatory for variable type.
minValueString

Minimum value for the variable.
Mandatory for variable type.
maxValueString

Maximum value for the variable.
Mandatory for variable type.
stepSizeString

Incremental value for the variable.
Mandatory for variable type.

POSSIBLE ERROR CODES

7103, 7301, 8083, 8504, 8516, 8518, 8535, 70323

Sample Request:

Copied
Copied
Copied
Copied
Copied
Copied
Copied
Copied

Show full

Show less

Download client libraries:  C# | GO | JAVA | PHP | PYTHON | NodeJS

Sample value for CONFIG parameter:

Copied

Show full

Show less

Sample Response:

Copied
 
 
Thanks for your interest. We shall get back to you shortly.