# How can I use constant inside a Rule?

**URL:** <https://community.auth0.com/t/how-can-i-use-constant-inside-a-rule/57899>\
**Category:** Get Help\
**Tags:** rules, configuration, saml\
**Created:** [February 15, 2021, 6:46pm UTC](https://community.auth0.com/t/how-can-i-use-constant-inside-a-rule/57899 "2021-02-15T18:46:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vt89](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/vt89/32/27618_2.png) [@vt89](https://community.auth0.com/u/vt89)\
**Post date:** [February 15, 2021, 6:46pm UTC](https://community.auth0.com/t/how-can-i-use-constant-inside-a-rule/57899/1 "2021-02-15T18:46:38Z")

</div>

Hi,  
I am making some tests implementing an SSO SAML using Auth0 as IdP and Salesforce as SP.  
I would customize the Attributes for the SAML Response generated on Auth0.

I figure out that I can use the Rules to do achieve that and the mapSamlAttributes function.  
Everything looks fine as long as I use either the user or context object.

My question is: how can I use constants?  
I have also tried using the configuration object but it seems its values are visible since they are never included inside the SAML Response: [Rule Configuration](https://auth0.com/docs/rules/configuration)

Here a piece of code:

function mapSamlAttributes(user, context, callback) {  
context.samlConfiguration.mappings = {  
“[http://schemas.xmlsoap.org/ws/2005/05/identity/claims/MyCustomAttribute](http://schemas.xmlsoap.org/ws/2005/05/identity/claims/MyCustomAttribute)”: “configuration.asd”  
};

callback(null, user, context);  
}

Thanks

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 16, 2021, 11:11am UTC](https://community.auth0.com/t/how-can-i-use-constant-inside-a-rule/57899/2 "2021-02-16T11:11:54Z")

</div>

Hey there! I think what you’re looking for is here:

> **[Configure Global Variables for Rules](https://auth0.com/docs/customize/rules/configure-global-variables-for-rules)**
>
> Describes how to configure global variables for rules using the Auth0 Dashboard.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [February 25, 2021, 10:39am UTC](https://community.auth0.com/t/how-can-i-use-constant-inside-a-rule/57899/3 "2021-02-25T10:39:42Z")

</div>


