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

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.

Hello welcome to the community :wave: :partying_face:

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

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.

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.