# How to validate Response Body Date against the Date Range Environment Variables

**URL:** <https://community.postman.com/t/how-to-validate-response-body-date-against-the-date-range-environment-variables/33335>\
**Category:** Help Hub\
**Tags:** automation, postman-api, test\
**Created:** [March 9, 2022, 3:09pm UTC](https://community.postman.com/t/how-to-validate-response-body-date-against-the-date-range-environment-variables/33335 "2022-03-09T15:09:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![farhanhasanali](https://avatars.discourse-cdn.com/v4/letter/f/b3f665/32.png) [@farhanhasanali](https://community.postman.com/u/farhanhasanali)\
**Post date:** [March 9, 2022, 3:09pm UTC](https://community.postman.com/t/how-to-validate-response-body-date-against-the-date-range-environment-variables/33335/1 "2022-03-09T15:09:14Z")

</div>

We have a internal tool within the company where we perform activity on participant and validate activity date using API. I am trying to figure out how I can test the date range boundary values. If i set the environment variable with a date that is outside the activity date i should see the Invalid date rage error. However if I select the date range within the boundary values i should see the participant data. Due to sensitivity I have masked the data

Here is what i did I set the params value as environment variable and setting the environment variable beginDate and endDate with dates but when i run the test i am getting an error.

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

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

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

 ![image](https://us1.discourse-cdn.com/getpostman/original/3X/0/4/043a5e5a2580e113b1c3fc6aabe12695590d0d9d.png)

_How I found the problem_:

_I’ve already tried_:
