# Array confused as boolean by postman?

**URL:** <https://community.postman.com/t/array-confused-as-boolean-by-postman/9461>\
**Category:** Help Hub\
**Created:** [December 6, 2019, 10:40am UTC](https://community.postman.com/t/array-confused-as-boolean-by-postman/9461 "2019-12-06T10:40:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![theToncheff](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@theToncheff](https://community.postman.com/u/theToncheff)\
**Post date:** [December 6, 2019, 10:40am UTC](https://community.postman.com/t/array-confused-as-boolean-by-postman/9461/1 "2019-12-06T10:40:35Z")

</div>

Hey, so I’m not exactly sure what’s the issue here yet. Excuse the bad code.  
So I have tried to create an array with 2 values that would be randomly picked.

```
var activeTF = ["true", "false"];
 postman.setEnvironmentVariable('index', 0);
 let randomActive = (_.random(0,1)); 
 pm.globals.set("randomActive", randomActive);
var index = parseInt(postman.getEnvironmentVariable('index'));
index = index + randomActive;
let aTF = activeTF[index];

```

And now I’m trying to test whether the response body has the correct value:

`pm.test("Approved Status is Correct" , function(){ pm.expect(pm.response.json().approved).equal((pm.environment.get(`appTF`))) }); pm.test("VIP Status is Correct" , function(){ pm.expect(pm.response.json().vip).include((pm.environment.get(`vTF`))) });`

Above I’ve tried both with include and equal but both fail, the first one I think the value is dashed when compared. Second one pm won’t recognise the array.

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/9/9/99d36788d8a31e384375665ceec4e0dfa2b4bbd7.png)

---

<div class="post-metadata">

**Author:** ![theToncheff](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@theToncheff](https://community.postman.com/u/theToncheff)\
**Post date:** [December 6, 2019, 10:56am UTC](https://community.postman.com/t/array-confused-as-boolean-by-postman/9461/2 "2019-12-06T10:56:42Z")

</div>

Fixed it with .equal(JSON.parse((the rest));
