# Error when using array in CSV file for response verification

**URL:** <https://community.postman.com/t/error-when-using-array-in-csv-file-for-response-verification/26291>\
**Category:** Help Hub\
**Created:** [July 29, 2021, 11:20pm UTC](https://community.postman.com/t/error-when-using-array-in-csv-file-for-response-verification/26291 "2021-07-29T23:20:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cmikkelsen](https://avatars.discourse-cdn.com/v4/letter/c/46a35a/32.png) [@cmikkelsen](https://community.postman.com/u/cmikkelsen)\
**Post date:** [July 29, 2021, 11:20pm UTC](https://community.postman.com/t/error-when-using-array-in-csv-file-for-response-verification/26291/1 "2021-07-29T23:20:58Z")

</div>

I have an API endpoint that I am testing that returns an array of values in the JSON response, for example:

[  
{  
“id”: “272ea3e0-9496-4153-99ba-30a4c87f30bb”,  
“description”: “CORRESP”,  
“allowCourtesyCopy”: true  
},  
{  
“id”: “423b0102-3dc8-4e91-b0b6-efcc52a478d7”,  
“description”: “COVER”,  
“allowCourtesyCopy”: true  
},  
{  
“id”: “87ccf4ce-6b79-4f4a-8cab-b50d81cc82b2”,  
“description”: “EX-1”,  
“allowCourtesyCopy”: true  
}  
]

I am using a CSV file containing the id & the expected response to call with the endpoint & validate the actual response, for example:

id,expected\_response  
1234,"[{ ““id””: ““272ea3e0-9496-4153-99ba-30a4c87f30bb””, ““description””: ““CORRESP””, ““allowCourtesyCopy””: true }, { ““id””: "“423b0102-3dc8-4e91-b0b6-efcc52a478d7"”, ““description””: ““COVER””, ““allowCourtesyCopy””: true }, { ““id””: "“87ccf4ce-6b79-4f4a-8cab-b50d81cc82b2"”, ““description””: ““EX-1"”, ““allowCourtesyCopy””: true }]”

For the endpoint I have this as my test:  
let jsonData = pm.response.json();

pm.test(“Response has expected values”, () =\> {  
// get expected response from data file  
expected\_response = pm.iterationData.get(‘expected\_response’);

```
// convert to json
expected_response = JSON.parse(expected_response);

// compare expected response to actual
pm.expect(jsonData).to.include(expected_response);

```

});

However when I run the test I get the following error:

Response has expected values | AssertionError: expected [Array(32)] to include [{ id: ‘272ea3e0-9496-4153-99ba-30a4c87f30bb’, description: ‘CORRESP’, allowCourtesyCopy: true }, { id: ‘423b0102-3dc8-4e91-b0b6-efcc52a478d7’, description: ‘COVER’, allowCourtesyCopy: true }, { id: ‘87ccf4ce-6b79-4f4a-8cab-b50d81cc82b2’, description: ‘EX-1’, allowCourtesyCopy: true }]

I can’t figure out why Postman is saying the actual response doesn’t match the expected response from the file. I have another data test that use a CSV that works, the only difference is that the expected response in that file is a dictionary like this:  
{  
“key”: “value”,  
“key”: “value”,  
“key”: “value”  
}

Any help would be most appreciated. Thanks in advance.
