This article covers the following topics:
Populating Readings Cells
When populating a reading the value sent will need to be an array because we have potentially multiple "readings" and potentially multiple rows in the table. So the variable you are looking for is the first connected variable which will have row as the type. Here is an example of one numeric table in a schedule, the variable ID we want is 33531:
{
"id": 33530,
"name": "ISO Difference",
"subname": null,
"systemName": "custom_numeric_table_273_934e3e5f01",
"description": null,
"type": "table",
"multiple": false,
"metaItems": [],
"connectedVariables": [
{
"id": 33531,
"name": "",
"subname": null,
"systemName": "custom_numeric_table_row_273_934e3e5f01",
"description": null,
"type": "row",
"multiple": false,
"metaItems": [],
"connectedVariables": [],
"unit": ";;",
"active": true
},
{
"id": 33532,
"name": "3D Vector",
"subname": null,
"systemName": "custom_numeric_table_column_calculation_273_00a3e3be9e_0",
"description": null,
"type": "calculation-column",
"multiple": false,
"metaItems": [],
"connectedVariables": [],
"unit": null,
"active": true
},
{
"id": 35179,
"name": "Round Example",
"subname": null,
"systemName": "custom_numeric_table_column_calculation_273_dd91935dce_1",
"description": null,
"type": "calculation-column",
"multiple": false,
"metaItems": [],
"connectedVariables": [],
"unit": null,
"active": true
},
{
"id": 33533,
"name": "Difference",
"subname": null,
"systemName": "custom_numeric_table_row_calculation_273_00a3e3be9e_0",
"description": null,
"type": "calculation-column",
"multiple": false,
"metaItems": [],
"connectedVariables": [],
"unit": null,
"active": true
},
{
"id": 33534,
"name": "3D Vector Difference",
"subname": null,
"systemName": "custom_numeric_table_calculation_273_008cece4f0_0",
"description": null,
"type": "calculation-table",
"multiple": false,
"metaItems": [],
"connectedVariables": [],
"unit": null,
"active": true
}
],
"unit": null,
"active": true
},
Here is the numeric table in the new QA for reference:
So to populate this table I used this body in the https://tqa.imageowl.com/api/rest/schedules/XXXX/add-results call:
{
"finalize": 0,
"variables": [
{
"id": 33531,
"rawValue" : [[1,2,3],[4,5,6]],
"value" : [1,1]
}
]
}
The "value" : [1,1] is basically a placeholder for each row, you can always use [1,1] for two rows, [1,1,1] for three rows, and so on. The values that you will see in the table are the rawValue array.
Populating Calculation Cells
Calculations in numeric tables are only performed when a user visits the new QA. If there is a need to complete the calculations without entering the new QA then they will need to be added programmatically.
When populating a calculation the value sent will need to be an array because we have potentially multiple multiple rows in the table. So the variable you are looking for is the first connected variable which will have row as the type. Here is an example of one numeric table in a schedule, the variable ID we want is 33532:
{
"id": 33530,
"name": "ISO Difference",
"subname": null,
"systemName": "custom_numeric_table_273_934e3e5f01",
"description": null,
"type": "table",
"multiple": false,
"metaItems": [],
"connectedVariables": [
{
"id": 33531,
"name": "",
"subname": null,
"systemName": "custom_numeric_table_row_273_934e3e5f01",
"description": null,
"type": "row",
"multiple": false,
"metaItems": [],
"connectedVariables": [],
"unit": ";;",
"active": true
},
{
"id": 33532,
"name": "3D Vector",
"subname": null,
"systemName": "custom_numeric_table_column_calculation_273_00a3e3be9e_0",
"description": null,
"type": "calculation-column",
"multiple": false,
"metaItems": [],
"connectedVariables": [],
"unit": null,
"active": true
},
{
"id": 35179,
"name": "Round Example",
"subname": null,
"systemName": "custom_numeric_table_column_calculation_273_dd91935dce_1",
"description": null,
"type": "calculation-column",
"multiple": false,
"metaItems": [],
"connectedVariables": [],
"unit": null,
"active": true
},
{
"id": 33533,
"name": "Difference",
"subname": null,
"systemName": "custom_numeric_table_row_calculation_273_00a3e3be9e_0",
"description": null,
"type": "calculation-column",
"multiple": false,
"metaItems": [],
"connectedVariables": [],
"unit": null,
"active": true
},
{
"id": 33534,
"name": "3D Vector Difference",
"subname": null,
"systemName": "custom_numeric_table_calculation_273_008cece4f0_0",
"description": null,
"type": "calculation-table",
"multiple": false,
"metaItems": [],
"connectedVariables": [],
"unit": null,
"active": true
}
],
"unit": null,
"active": true
},
Here is the numeric table in the new QA for reference:
So to populate this table I used this body in the https://tqa.imageowl.com/api/rest/schedules/XXXX/add-results call:
{
"finalize": 0,
"variables": [
{
"id": 33532,
"rawValue" : [[3.7417],[8.7750]],
"value" : [1,1]
}
]
}
The "value" : [1,1] is basically a placeholder for each row, you can always use [1,1] for two rows, [1,1,1] for three rows, and so on. The values that you will see in the table are the rawValue array.
Comments
0 comments
Please sign in to leave a comment.