# How can I verify all array values from a variable in my request text response

**URL:** <https://community.postman.com/t/how-can-i-verify-all-array-values-from-a-variable-in-my-request-text-response/36957>\
**Category:** Help Hub\
**Created:** [July 7, 2022, 1:45pm UTC](https://community.postman.com/t/how-can-i-verify-all-array-values-from-a-variable-in-my-request-text-response/36957 "2022-07-07T13:45:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![security-engineer-12](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/security-engineer-12/32/12560_2.png) [@security-engineer-12](https://community.postman.com/u/security-engineer-12)\
**Post date:** [July 7, 2022, 1:45pm UTC](https://community.postman.com/t/how-can-i-verify-all-array-values-from-a-variable-in-my-request-text-response/36957/1 "2022-07-07T13:45:25Z")

</div>

Hello, I have a array variable with multiple ids, and I need to verify the ids if all of them exists in request’s response. response is in TEXT.

Ex. I have idsDashboard variable that is array which contains [100,101,102,103]  
I have a response in TEXT format. then i want all ids to be check if they are in the response.

---

<div class="post-metadata">

**Author:** ![cmnazario](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/cmnazario/32/10207_2.png) [@cmnazario](https://community.postman.com/u/cmnazario)\
**Post date:** [July 7, 2022, 8:24pm UTC](https://community.postman.com/t/how-can-i-verify-all-array-values-from-a-variable-in-my-request-text-response/36957/2 "2022-07-07T20:24:19Z")

</div>

Hello welcome to the community 👋 🥳

Could you give more details of the data with example screenshots?

---

<div class="post-metadata">

**Author:** ![security-engineer-12](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/security-engineer-12/32/12560_2.png) [@security-engineer-12](https://community.postman.com/u/security-engineer-12)\
**Post date:** [July 8, 2022, 1:40am UTC](https://community.postman.com/t/how-can-i-verify-all-array-values-from-a-variable-in-my-request-text-response/36957/3 "2022-07-08T01:40:43Z")

</div>

Hi cmnazario,

here is the screenshot. basically, i wanted to verify all data in my array variable idsSearchDashboard if the ids are in the response. Thank you.

 ![image](https://us1.discourse-cdn.com/getpostman/original/2X/4/4d52e9a276a5e623dfba71b2d8da13916dbd9778.png)

---

<div class="post-metadata">

**Author:** ![security-engineer-12](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/security-engineer-12/32/12560_2.png) [@security-engineer-12](https://community.postman.com/u/security-engineer-12)\
**Post date:** [July 8, 2022, 9:06am UTC](https://community.postman.com/t/how-can-i-verify-all-array-values-from-a-variable-in-my-request-text-response/36957/4 "2022-07-08T09:06:47Z")

</div>

was able to figure it out with the below syntax

pm.test(“includes”, function () {  
var ids = JSON.parse(pm.environment.get(“idsSearchDashboard”));  
for(var i in ids){  
pm.expect(pm.response.text()).to.include(ids[i]);  
}  
});

Thank you.
