Create tableON THIS PAGE
Information note LOCKED.
This API is extremely reliable and will not be broken unless absolutely necessary.
Method
POST
Path
/qrs/[type]/table?filter={filter}&skip={skip}&take={take}&sortColumn={sortColumn}&orderAscending={orderAscending}
Description
Add a new table definition.
Optionally, include an empty GUID in the API call. Optionally, filter the columns in the table.
Tables are used to list specific properties for entities.
The Name property must not include spaces.
Use [columnType] in the following way:
When [columnType] is set to Property , the Definition property must contain the property name.
When [columnType] is set to Function , the Definition property must contain the function that produces the column values. Initially, the supported functions only include count([type1], [type2],…) .
When [columnType] is set to List , the Definition property must contain the list item type and the list property must be specified as a list of columns.
Body
TableDefinition:
{
"id": "00000000-0000-0000-0000-000000000000",
"type": "...",
"columns":
[
{
"name": "...",
"columnType": Property/Function/List,
"definition": "[property name]/[function name]/[list item type]",
"list":
[
{ <columns> }
]
},
...
]
}
Return value
ITable:
{
"id": "00000000-0000-0000-0000-000000000000",
"type": "...",
"columnNames":
[
"name1",
"name2",
...
],
"rows":
[
{
[
"item1.1",
"item1.2",
...
]
},
{
[
"item2.1",
"item2.2",
...
]
},
...
]
}
Optional parameters
Example: Create simple table for engine services
This example shows how to create a table definition for engine services. The table is considered to be simple, since it only contains a single “property”.
REQUEST: POST https://SELUN-USER.qlik.com:4242/qrs/engineservice/table?Xrfkey=abcdefghijklmnop HTTP/1.1
Accept-Encoding: gzip,deflate
X-Qlik-User: UserDirectory=INTERNAL; UserId=sa_repository
Accept-Charset: utf-8; q=0.9, us-ascii;q=0.1, iso-8859-1
Accept: text/xml; q=0.1, application/json; q=0.2
X-Qlik-Xrfkey: abcdefghijklmnop
Content-Type: application/json
Content-Length: 168
Host: SELUN-USER.qlik.com:4242
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
BODY: {
"id": "00000000-0000-0000-0000-000000000000",
"columns":
[
{
"name": "EngineServiceName",
"columntype": "Property",
"definition": "name"
}
]
}
RESPONSE: {
"id": "00000000-0000-0000-0000-000000000000",
"columnNames": ["EngineServiceName"],
"rows": [
["Central Engine"],
["First Engine"],
["Second Engine"],
["Third Engine"],
["Fourth Engine"],
["Fifth Engine"]
],
"schemaPath": "Table"
}
Example: Create complex table for engine services
This example shows how to create a table definition for engine services. The table is considered to be complex, since there are two “property” columns (Function and List, respectively) for each row.
REQUEST: POST https://SELUN-USER.qlik.com:4242/qrs/repositoryservice/table?Xrfkey=abcdefghijklmnop HTTP/1.1
Accept-Encoding: gzip,deflate
X-Qlik-User: UserDirectory=INTERNAL; UserId=sa_repository
Accept-Charset: utf-8; q=0.9, us-ascii;q=0.1, iso-8859-1
Accept: text/xml; q=0.1, application/json; q=0.2
X-Qlik-Xrfkey: abcdefghijklmnop
Content-Type: application/json
Content-Length: 691
Host: SELUN-USER.qlik.com:4242
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
BODY: {
"id": "00000000-0000-0000-0000-000000000000",
"columns":
[
{
"name":"RepositoryServiceId",
"columnType":"Property",
"definition":"id"
},
{
"name":"RepositoryServiceName",
"columnType":"Property",
"definition":"name"
},
{
"name":"RepositoryServiceTagCount",
"columnType":"Function",
"definition":"count(Tag)"
},
{
"name": "RepositoryServiceTags",
"columnType": "List",
"definition": "Tag",
"list":
[
{
"name": "TagID",
"columnType": "Property",
"definition": "id"
},
{
"name": "TagName",
"columnType": "Property",
"definition": "name"
}
]
}
]
}
RESPONSE: {
"id": "00000000-0000-0000-0000-000000000000",
"columnNames": [
"RepositoryServiceId",
"RepositoryServiceName",
"RepositoryServiceTagCount",
"RepositoryServiceTags"
],
"rows": [
[
"626d3062-0c39-46f2-bca8-c693d3bb3db9",
"Second",
2,
{
"columnNames": [
"TagID",
"TagName"
],
"rows": [
[
"231e1ef9-f22d-4203-9b10-6e863b76fe8c",
"Sweden"
],
[
"cf5b840d-e7c9-4462-87b8-8abc48ae5442",
"Europe"
]
],
"schemaPath": "TableBase"
}
],
[
"70f61960-be45-4d0c-9431-14d82a510374",
"Central Repository",
0,
{
"columnNames": [
"TagID",
"TagName"
],
"rows": [],
"schemaPath": "TableBase"
}
],
[
"dc656392-ba1f-46f2-95a7-a3dd96c72304",
"First",
2,
{
"columnNames": [
"TagID",
"TagName"
],
"rows": [
[
"12c7d9a6-7b93-4cc5-b47e-86821f72f5d9",
"Japan"
],
[
"57b4b311-fd75-4bd2-b8d7-24366ace1934",
"Asia"
]
],
"schemaPath": "TableBase"
}
]
],
"schemaPath": "Table"
}