# How to validate specific keyword in response

**URL:** <https://community.postman.com/t/how-to-validate-specific-keyword-in-response/43753>\
**Category:** Help Hub\
**Created:** [February 9, 2023, 5:58am UTC](https://community.postman.com/t/how-to-validate-specific-keyword-in-response/43753 "2023-02-09T05:58:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![vbadgujarcsod](https://avatars.discourse-cdn.com/v4/letter/v/51bf81/32.png) [@vbadgujarcsod](https://community.postman.com/u/vbadgujarcsod)\
**Post date:** [February 9, 2023, 5:58am UTC](https://community.postman.com/t/how-to-validate-specific-keyword-in-response/43753/1 "2023-02-09T05:58:04Z")

</div>

I would like validate specific string in attribute value.

Please refer attached screenshot.

 ![Screenshot 2023-02-09 at 11.22.16 AM](https://us1.discourse-cdn.com/getpostman/original/3X/9/0/905a6830837243c8e7bb4604b1bff2bced2c1709.png)

I would like to validate description has python string.

I had tried below snippets but it is not validating.

pm.test(“Body matches string”, function () {  
pm.expect(pm.response.text()).to.include(“golang”);  
});

pm.test(“Search Topic 1”, function () {  
var jsonData = pm.response.json();  
pm.expect(jsonData.cards[1].description).include(pm.environment.get(“searchtopic1”));  
});

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [February 9, 2023, 10:28am UTC](https://community.postman.com/t/how-to-validate-specific-keyword-in-response/43753/2 "2023-02-09T10:28:13Z")

</div>

Your second snippet is nearly there.

Array’s start at 0. (Although I’m not 100% sure that the cards element is an array, as you didn’t post that part of the response. (Therefore I’m assuming that its an array).

```auto
const jsonData = pm.response.json()

pm.test("Search Topic 1", function () {
    pm.expect(jsonData.cards[0].description).to.include("Python");
});

```

If this still fails, ensure that you are able to target the description by defining it as its own variable, and console logging it. You should maybe do the same for the search topic.

On a side note, you didn’t include a screenshot or details on what the error being returned was.

When posting code, please use the preformatted text option in the editor to stop all of the code being aligned to the left.
