Creating a Variable Group
- Updated2025-08-15
- 2 minute(s) read
Required permission: VariableCreateDeleteGroup
A VariableValueGroup references a customized list of variable values. You can read the values of these variables using a single request. You can also use the $deltatoken feature to get only updated values for the variables.
To use a variable group, you must first create the group. For example, POST http://my_server:3580/nivariable/VariableValueGroups
POST JSON data:
HTTP Header - Content-Type : application/jsonHTTP Body -{
"VariableValues"
: [{ "__metadata" : {
"uri"
: "http://my_server:3580/nivariable/VariableValues('ni.var.psp://localhost/process1/variable1')"} }, { "__metadata" : {
"uri"
: "http://my_server:3580/nivariable/VariableValues('ni.var.psp://localhost/process2/variable2')"} }]}
POST XML data:
HTTP Header - Content-Type : application/xmlHTTP Body -<?xml version="1.0" encoding="utf-8"?><entry xmlns:d="http://my_server:3580/nivariable/" xmlns:m="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata" xmlns="http://www.w3.org/2005/Atom"> <title type="text"></title> <updated>2010-02-27T21:36:47Z</updated> <author> <name /> </author> <category term="nivariable.VariableValueGroup" scheme="http://schemas.microsoft.com/ado/2007/08/dataservices/scheme" /> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/VariableValues" href="VariableValues('ni.var.psp://localhost/process1/variable1')"/> <link rel="http://schemas.microsoft.com/ado/2007/08/dataservices/related/VariableValues" href="VariableValues('ni.var.psp://localhost/process1/variable2')"/> <content type="application/xml"> <m:properties> <d:Timeout>15000</d:Timeout> </m:properties> </content></entry>
If the VariableValueGroup is created, the server returns a 201 response and adds a Location header indicating the newly created resource's URI. The response body contains the ID of the newly created group.
If the VariableValueGroup is not created, the server returns one of the following responses:
- 500 Internal Server Error - The error occurred on the server side.
- 400 Bad Request - The requested POST data is invalid.
The response body uses the standard OData error object to indicate the reason of failure.