# Detect environment type in BeforeProvisioning or any Rule

**URL:** <https://developer.sailpoint.com/discuss/t/detect-environment-type-in-beforeprovisioning-or-any-rule/10959>\
**Category:** SHF Discussion and Questions\
**Tags:** identity-security-cloud, rules\
**Created:** [May 5, 2023, 3:22pm UTC](https://developer.sailpoint.com/discuss/t/detect-environment-type-in-beforeprovisioning-or-any-rule/10959 "2023-05-05T15:22:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hearst2k](https://avatars.discourse-cdn.com/v4/letter/h/41988e/32.png) [@hearst2k](https://developer.sailpoint.com/discuss/u/hearst2k)\
**Post date:** [May 5, 2023, 3:22pm UTC](https://developer.sailpoint.com/discuss/t/detect-environment-type-in-beforeprovisioning-or-any-rule/10959/1 "2023-05-05T15:22:57Z")

</div>

In IdentityNow, is there a way to determine which environment the code is executing in? E.g.:

if(environment.equals(“myenv-sb”)) appName = “AD - Sandbox”;

if(environment.equals(“myenv”)) appName = “AD - Production”;

Thanks.

---

<div class="post-metadata">

**Author:** ![ajmerasunny1](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@ajmerasunny1](https://developer.sailpoint.com/discuss/u/ajmerasunny1)\
**Post date:** [May 5, 2023, 6:21pm UTC](https://developer.sailpoint.com/discuss/t/detect-environment-type-in-beforeprovisioning-or-any-rule/10959/2 "2023-05-05T18:21:37Z")

</div>

You could use IDN /org-config API to get that information and then use it in the before provisioning rule.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/sailpoint/original/2X/f/f2136700ed5e3703e0b85e02f6be799dacca7735.png) [@system](https://developer.sailpoint.com/discuss/u/system)\
**Post date:** [July 19, 2023, 2:24pm UTC](https://developer.sailpoint.com/discuss/t/detect-environment-type-in-beforeprovisioning-or-any-rule/10959/3 "2023-07-19T14:24:57Z")

</div>


