Forum Discussion

nkasemsan's avatar
nkasemsan
Occasional Contributor
8 years ago

Property Transfer Test Step adding extra bracket in the value

Hi,

 

I'm new to SOAPUI and am currently using the OpenSource version 5.3.0.  I have a Property Transfer Test step that retrieves an attribute in an element from the previous step.  This Property Transfer step works; however, it's putting brackets around the value.  I think this may be a result of the JSON response being an array.   It is causing a problem because I am using this value in the next step for a GET request and it's placing the brackets in the GET request, causing a 404.  

 

Is there a way to remove the brackets so that when I run the Property Transfer Step I just get "[PatientID]" instead of

"[[PatientId]]"?  I've attached a screenshot of the value for clarification.

 

Any suggestions much appreciated!

 

Thanks,

Nhan

  • PaulMS's avatar
    PaulMS
    Super Contributor

     

    To get the first item use the expression $.ItemList[0].Id

     

    The response was an array because [:1] notation will include all items from index 0 (inclusive) until index 1 (exclusive)

    https://github.com/json-path/JsonPath

    • nkasemsan's avatar
      nkasemsan
      Occasional Contributor

      That was the issue.  I'm not sure why I didn't even notice that to begin with.   It's working now. Thank you!

  • These replies have been moved.