We recommend switching to the latest versions of Edge, Firefox, Chrome or Safari. Using Internet Explorer will result in a loss of website functionality.

Passing Multiple records into a control via the Assure API

Comments

4 comments

  • Avatar
    Gerard Cafaro

    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"
    0
    Comment actions Permalink
  • Avatar
    Athar Syed

    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"

     

    0
    Comment actions Permalink
  • Avatar
    Gerard Cafaro

    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=true

    Script returned 3 instances:

    INFO: Instance Count: 3

    Control data showed all three records:

     

    0
    Comment actions Permalink
  • Avatar
    Athar Syed

    It was the condition in Control point which cause to pick only 1 record and after fixing, it did pickup all the records.

    Thanks Gerard!

    0
    Comment actions Permalink

Please sign in to leave a comment.