Passing Multiple records into a control via the Assure API
How can we pass multiple records into a Control that got triggered through Assure API, into its property TextDataItem?
The examples in API guide has syntax for a single record.
example2.TextDataItem=true,111,James Bond,1000.00,20051202,100.00,1
If I have to pass another record with values - true,112,Mike Tyson,1000.00,20051202,100.00,2
How can i achieve that?
-
The line separator is controlled by the Layout and is a new-line (\n) character by default. This can be updated via the Record Ending and Record Value settings within the Layout if a different character is needed:
Here's a snippet of a curl command's payload to trigger a control with three records each containing three columns. I left the default new-line character line separator:
"textDataItem":"record,number,one\nsecond,record,here\nand,third,record"
-
Thanks Gerard for the response, i was able to pass multiple records with \n new-line character separator, but it only picked up the last record.It generated a control report with the last record and control data has also the last record.
example2.TextDataItem=true,111,James Bond,1000.00,20051202,100.00,1\ntrue,112,James Bond1,1000.00,20051202,100.00,2\ntrue,222,Mike Tyson,2000.00,20051202,000.00,2
looking to capture all the records that are passed in "textDataItem"
-
What's the logic within the control for capturing / storing data? I get all three records with an \n separator. I also switched the property file-based method, in case the embedded new-line characters within the TextDataItem property and the "real" new-line characters throughout the property file were conflicting. Although, I captured three records in this setup too:
example2.ControlEntity=apitestce
example2.ControlPoint=apitestcp
example2.TextDataItem=record,number,one\nsecond,record,here\nand,third,record
example2.WaitForResponse=trueScript returned 3 instances:
INFO: Instance Count: 3
Control data showed all three records:
Please sign in to leave a comment.
Comments
4 comments