---
sourceDocument: Xanadu API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/xanadu/api-reference

 Release :

    - xanadu

ft:locale :

    - en-US

ft:publication_title :

    - Xanadu API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# GlideCurrencyConfig - Scoped

# GlideCurrencyConfig - Scoped {#ariaid-title1}

* Release version: Xanadu
* 
* Updated August 1, 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 11 minutes to read

The GlideCurrencyConfig API provides methods to retrieve various configuration information for FX Currency fields.

You can acquire information for a specific FX Currency field by calling the [GlideCurrencyConfig(Object
ed)](https://servicenow-prod.fluidtopics.net/Kr1dIjlVncTpo8xyMNCIWQ#S-GCConfig-GlideCurrencyConfig_O "Instantiates a GlideCurrencyConfig object that enables the retrieval of the configuration information for a specific FX Currency field.") constructor, which associates a specific FX Currency field to the
instantiated object. When calling the various GlideCurrencyConfig()
methods, if a record exists in the FX Currency Configuration \[fx_configuration\] table for the
FX Currency field, the requested value is passed back. If a record or field is not available,
the default value is passed back. You can also acquire the default FX Currency configuration
values by calling the [GlideCurrencyConfig()](https://servicenow-prod.fluidtopics.net/Kr1dIjlVncTpo8xyMNCIWQ#S-GCConfig-GlideCurrencyConfig "Instantiates a GlideCurrencyConfig object that enables the retrieval of global default FX Currency configuration information.") constructor.

For additional information on FX Currency configuration, see [Setting up and operating FX Currency
fields](https://www.servicenow.com/docs/access?context=fx-currency&version=xanadu&pubname=xanadu-platform-administration&ft:locale=en-US).

This class runs is in the `sn_currency` namespace.

## GlideCurrencyConfig - GlideCurrencyConfig() {#ariaid-title2}

Instantiates a GlideCurrencyConfig object that enables the retrieval of global default
FX Currency configuration information.
When calling the available methods on this type of GlideCurrencyConfig object, the return
values are the FX Currency global defaults from system properties. If a global default is
not defined in system properties, a hard-coded default is returned (this can also be an
empty value if not configured).

This object does not provide configuration information for a specific FX Currency field. To
retrieve specific FX Currency field information, use the [GlideCurrencyConfig(Object
ed)](https://servicenow-prod.fluidtopics.net/Kr1dIjlVncTpo8xyMNCIWQ#S-GCConfig-GlideCurrencyConfig_O "Instantiates a GlideCurrencyConfig object that enables the retrieval of the configuration information for a specific FX Currency field.") constructor.

For more information, see [Configuring FX Currency global
settings](https://www.servicenow.com/docs/access?context=fx-currency-configure&version=xanadu&pubname=xanadu-platform-administration&ft:locale=en-US).
{#S-GCConfig-GlideCurrencyConfig__table_hsj_2rk_qjb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 1. Parameters]

{#S-GCConfig-GlideCurrencyConfig__table_hsj_2rk_qjb}  

    var cur_config = new sn_currency.GlideCurrencyConfig();

## GlideCurrencyConfig - GlideCurrencyConfig(Object ed) {#ariaid-title3}

Instantiates a GlideCurrencyConfig object that enables the retrieval of the
configuration information for a specific FX Currency field.
When calling the available methods on this type of GlideCurrencyConfig object, the return
values are from the FX Currency Configuration \[fx_configuration\] record associated with the
FX Currency field, if a record exists. If a record does not exist, default values are
returned.

For more information, see [Configuring FX Currency global
settings](https://www.servicenow.com/docs/access?context=fx-currency-configure&version=xanadu&pubname=xanadu-platform-administration&ft:locale=en-US).
{#S-GCConfig-GlideCurrencyConfig_O__table_cgv_vnk_qjb__entry__3}

| Name | Type | Description |
|-|-|-|
| ed | GlideElementDescriptor | GlideElementDescriptor object of the FX Currency field to associate with the GlideCurrencyConfig object. |
[Table 2. Parameters]

{#S-GCConfig-GlideCurrencyConfig_O__table_cgv_vnk_qjb}  

    var grCurr = new GlideRecord('my_FXCurrency_table');
    var curr_field = grCurr.getElement('currency');
    var ed = curr_field.getED();
    var cur_config = new sn_currency.GlideCurrencyConfig(ed);

## GlideCurrencyConfig - getAggregationSource() {#ariaid-title4}

Returns the aggregation source value for an FX Currency field.
If called on an existing FX Currency field that has a corresponding FX Currency
Configuration \[fx_configuration\] record, returns the value of the Aggregation Source
(aggregation_source) field. Otherwise, if a new record, returns a default value.

For more information on aggregation source, see [Specify the table field and its currency display
parameters](https://www.servicenow.com/docs/access?context=configure-fx-currency-field-behavior&version=xanadu&pubname=xanadu-platform-administration&ft:locale=en-US).
{#S-GCConfig-getAggregationSource__table_yvy_j1r_sjb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 3. Parameters]

{#S-GCConfig-getAggregationSource__table_yvy_j1r_sjb} {#S-GCConfig-getAggregationSource__table_zvy_j1r_sjb__entry__2}

| Type | Description |
|-|-|
| String | Source of values for aggregations. The returned value depends on the constructor used to instantiate the object. * GlideCurrencyConfig(Object ed): If an fx_configuration record exists, returns the aggregation_source field from the fx_configuration record that is associated with the FX Currency field specified by the GlideElementDescriptor passed in the constructor. If no fx_configuration record, follows the GlideCurrencyConfig() rules. * GlideCurrencyConfig(): If set, returns the value in the glide.currency2.aggregation_source field in system properties. Otherwise, returns a hard-coded default of `reference`. {#S-GCConfig-getAggregationSource__ul_bkg_fct_tjb} Possible values: * default * as_entered * reference {#S-GCConfig-getAggregationSource__ul_thb_kcs_tjb} |
[Table 4. Returns]

{#S-GCConfig-getAggregationSource__table_zvy_j1r_sjb}  
This code example returns the default aggregation source.

    var cur_config = new sn_currency.GlideCurrencyConfig();
    var curr_agg_source = cur_config.getAggregationSource();

This code example returns the aggregation source for a specific FX Currency field.

    var grCurr = new GlideRecord('my_FXCurrency_table');
    var curr_field = grCurr.getElement('currency');
    var ed = curr_field.getED();
    var cur_config = new sn_currency.GlideCurrencyConfig(ed);
    var curr_agg_source = cur_config.getAggregationSource();

## GlideCurrencyConfig - getConversionDateSource() {#ariaid-title5}

Returns the field used as the source of the date and time for the currency conversion.
If called on an existing FX Currency field that has a corresponding FX Currency
Configuration \[fx_configuration\] record, returns the value of the Conversion Date Source
(conversion_date_source) field. Otherwise, if a new record, returns "null".

For more information on the Conversion Date Source field, see [Identify the rate table and date
source for currency conversions](https://www.servicenow.com/docs/access?context=configure-fx-currency-field-behavior&version=xanadu&pubname=xanadu-platform-administration&ft:locale=en-US).
{#S-GCConfig-getConversionDateSource__table_cdl_yyq_sjb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 5. Parameters]

{#S-GCConfig-getConversionDateSource__table_cdl_yyq_sjb} {#S-GCConfig-getConversionDateSource__table_ddl_yyq_sjb__entry__2}

| Type | Description |
|-|-|
| String | Field in the record used as the conversion date source. The returned value depends on the constructor used to instantiate the object. * GlideCurrencyConfig(Object ed): If an fx_configuration record exists, returns the conversion_date_source field from the fx_configuration record that is associated with the FX Currency field specified by the GlideElementDescriptor passed in the constructor. If no fx_configuration record, follows the GlideCurrencyConfig() rules. * GlideCurrencyConfig(): Returns `null`. {#S-GCConfig-getConversionDateSource__ul_wln_cqt_tjb} |
[Table 6. Returns]

{#S-GCConfig-getConversionDateSource__table_ddl_yyq_sjb}  
This code example returns the conversion date source for a specific FX Currency field.

    var grCurr = new GlideRecord('my_FXCurrency_table');
    var curr_field = grCurr.getElement('currency');
    var ed = curr_field.getED();
    var cur_config = new sn_currency.GlideCurrencyConfig(ed);
    var curr_conv_date_src = cur_config.getConversionDateSource();

## GlideCurrencyConfig - getDisplayDigits() {#ariaid-title6}

Returns the number of digits to display for an FX Currency field.
If called on an existing FX Currency field that has a corresponding FX Currency
Configuration \[fx_configuration\] record, returns the value of the Display Digits
(display_digits) field. Otherwise, if a new record, returns a default value.
{#S-GCConfig-getDisplayDigits__table_pxs_myp_sjb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 7. Parameters]

{#S-GCConfig-getDisplayDigits__table_pxs_myp_sjb} {#S-GCConfig-getDisplayDigits__table_qxs_myp_sjb__entry__2}

| Type | Description |
|-|-|
| Number | Number of digits to display for the FX Currency field. The returned value depends on the constructor used to instantiate the object. * GlideCurrencyConfig(Object ed): If an fx_configuration record exists, returns the value of the display_digits field in the FX Currency Configuration \[fx_configuration\] record that is associated with the FX Currency field specified by the GlideElementDescriptor passed in the constructor. If no fx_configuration record, follows the GlideCurrencyConfig() rules. * GlideCurrencyConfig(): If set, returns the value of the glide.currency2.display_digits property in system properties. Otherwise, returns `-1`. {#S-GCConfig-getDisplayDigits__ul_wln_cqt_tjb} |
[Table 8. Returns]

{#S-GCConfig-getDisplayDigits__table_qxs_myp_sjb}  
This code example returns the default number of display digits.

    var cur_config = new sn_currency.GlideCurrencyConfig();
    var curr_display_digits = cur_config.getDisplayDigits();

This code example returns the display digits for a specific FX Currency field.

    var grCurr = new GlideRecord('my_FXCurrency_table');
    var curr_field = grCurr.getElement('currency');
    var ed = curr_field.getED();
    var cur_config = new sn_currency.GlideCurrencyConfig(ed);
    var curr_display_digits = cur_config.getDisplayDigits();

## GlideCurrencyConfig - getDisplayValue() {#ariaid-title7}

Returns the currency code used to convert the FX Currency value when it appears in
lists and reports.
If called on an existing FX Currency field that has a corresponding FX Currency
Configuration \[fx_configuration\] record, returns the value of the Display Value Currency
(display_value) field. Otherwise, if a new record, returns a default value.
{#S-GCConfig-getDisplayValue__table_etg_bsk_qjb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 9. Parameters]

{#S-GCConfig-getDisplayValue__table_etg_bsk_qjb} {#S-GCConfig-getDisplayValue__table_ftg_bsk_qjb__entry__2}

| Type | Description |
|-|-|
| String | Currency code to use to display the FX Currency field. The returned value depends on the constructor used to instantiate the object. * GlideCurrencyConfig(Object ed): If an fx_configuration record exists, returns the display_value field, which contains the currency code, from the fx_configuration record that is associated with the FX Currency field specified by the GlideElementDescriptor passed in the constructor. If no fx_configuration record, follows the GlideCurrencyConfig() rules. * GlideCurrencyConfig(): If set, returns the value of the glide.currency2.display_value property in system properties. Otherwise, returns `as_entered`. {#S-GCConfig-getDisplayValue__ul_ids_p5t_tjb} Possible values: * default: Global default. This is the value in the glide.currency2.display_digits property. * as_entered: Currency value as entered by the user. * in_session_currency: Currency value converted to the session currency. Session currency is based on the user's locale. * in_reference_currency: Reference value if computed and stored. Otherwise, the currency value converted to the reference currency. {#S-GCConfig-getDisplayValue__ul_i2b_ctk_qjb} |
[Table 10. Returns]

{#S-GCConfig-getDisplayValue__table_ftg_bsk_qjb}  
This code example returns the default currency code.

    var cur_config = new sn_currency.GlideCurrencyConfig();
    var curr_display_value = cur_config.getDisplayValue();

This code example returns the display currency code for a specific FX Currency field.

    var grCurr = new GlideRecord('my_FXCurrency_table');
    var curr_field = grCurr.getElement('currency');
    var ed = curr_field.getED();
    var cur_config = new sn_currency.GlideCurrencyConfig(ed);
    var curr_display_value = cur_config.getDisplayValue();

## GlideCurrencyConfig - getRateFilterRateTableField() {#ariaid-title8}

Returns the rate table field used as a rate table filter for an FX Currency
field.
If called on an existing FX Currency field that has a corresponding FX Currency
Configuration \[fx_configuration\] record, returns the value of the Rate Table Field
(rate_filter_rate_table_field). Otherwise, if a new record, returns a default value.

For more information on rate table filters, see [Select the rate and target table
fields used for filtering](https://www.servicenow.com/docs/access?context=configure-fx-currency-field-behavior&version=xanadu&pubname=xanadu-platform-administration&ft:locale=en-US).
{#S-GCConfig-getRateFilterRateTableField__table_nlm_5cr_sjb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 11. Parameters]

{#S-GCConfig-getRateFilterRateTableField__table_nlm_5cr_sjb} {#S-GCConfig-getRateFilterRateTableField__table_olm_5cr_sjb__entry__2}

| Type | Description |
|-|-|
| String | Field in the rate table used to filter the rate table records. The returned value depends on the constructor used to instantiate the object. * GlideCurrencyConfig(Object ed): If an fx_configuration record exists, returns the rate_filter_rate_table_field from the fx_configuration record that is associated with the FX Currency field specified by the GlideElementDescriptor passed in the constructor. If no fx_configuration record, follows the GlideCurrencyConfig() rules. * GlideCurrencyConfig(): Returns `null`. {#S-GCConfig-getRateFilterRateTableField__ul_fdy_wg5_tjb} |
[Table 12. Returns]

{#S-GCConfig-getRateFilterRateTableField__table_olm_5cr_sjb}  
This code example returns the rate table field used to filter rate table records for a
specific FX Currency field.

    var grCurr = new GlideRecord('my_FXurrency_table');
    var curr_field = grCurr.getElement('currency');
    var ed = curr_field.getED();
    var cur_config = new sn_currency.GlideCurrencyConfig(ed);
    var curr_reference_currency = cur_config.getRateFilterRateTableField();

## GlideCurrencyConfig - getRateFilterTargetTableField() {#ariaid-title9}

Returns the target table field used to filter the rate table records for an FX Currency
field.
If called on an existing FX Currency field that has a corresponding FX Currency
Configuration \[fx_configuration\] record, returns the value of the Target Table Field
(rate_filter_target_table_field). Otherwise, if a new record, returns a default value.

For more information on rate table filters, see [Select the rate and target table
fields used for filtering](https://www.servicenow.com/docs/access?context=configure-fx-currency-field-behavior&version=xanadu&pubname=xanadu-platform-administration&ft:locale=en-US).
{#S-GCConfig-getRateFilterTargetTableField__table_zdy_gcr_sjb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 13. Parameters]

{#S-GCConfig-getRateFilterTargetTableField__table_zdy_gcr_sjb} {#S-GCConfig-getRateFilterTargetTableField__table_a2y_gcr_sjb__entry__2}

| Type | Description |
|-|-|
| String | Field in the target table used/to use to filter the rate table. The returned value depends on the constructor used to instantiate the object. * GlideCurrencyConfig(Object ed): If an fx_configuration record exists, returns the rate_filter_target_table_field from the fx_configuration record that is associated with the FX Currency field specified by the GlideElementDescriptor passed in the constructor. If no fx_configuration record, follows the GlideCurrencyConfig() rules. * GlideCurrencyConfig(): Returns `null`. {#S-GCConfig-getRateFilterTargetTableField__ul_ids_p5t_tjb} |
[Table 14. Returns]

{#S-GCConfig-getRateFilterTargetTableField__table_a2y_gcr_sjb}  
This code example returns the default rate filter, target table field.

    var cur_config = new sn_currency.GlideCurrencyConfig();
    var curr_rate_filter = cur_config.getRateFilterTargetTableField();

This code example returns the rate filter, target table field for a specific FX Currency
field.

    var grCurr = new GlideRecord('my_FXCurrency_table');
    var curr_field = grCurr.getElement('currency');
    var ed = curr_field.getED();
    var cur_config = new sn_currency.GlideCurrencyConfig(ed);
    var curr_rate_filter = cur_config.getRateFilterTargetTableField();

## GlideCurrencyConfig - getRateTable() {#ariaid-title10}

Returns the rate table used to convert currency for an FX Currency field.
If called on an existing FX Currency field that has a corresponding FX Currency
Configuration \[fx_configuration\] record, returns the value of the Rate Table Field
(rate_filter_rate_table_field). Otherwise, if a new record, returns a default value.

For more information on FX Currency rate tables, see [Identify the rate table and date
source for currency conversions](https://www.servicenow.com/docs/access?context=configure-fx-currency-field-behavior&version=xanadu&pubname=xanadu-platform-administration&ft:locale=en-US).
{#S-GCConfig-getRateTable__table_mtg_knq_sjb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 15. Parameters]

{#S-GCConfig-getRateTable__table_mtg_knq_sjb} {#S-GCConfig-getRateTable__table_ntg_knq_sjb__entry__2}

| Type | Description |
|-|-|
| String | Name of the rate table used to perform the currency conversion. The returned value depends on the constructor used to instantiate the object. * GlideCurrencyConfig(Object ed): If an fx_configuration record exists, returns the rate_table_field field from the fx_configuration record that is associated with the FX Currency field specified by the GlideElementDescriptor passed in the constructor. If no fx_configuration record, follows the GlideCurrencyConfig() rules. * GlideCurrencyConfig(): If set, returns the value of the glide.currency2.system_rate_table property from system properties. Otherwise, returns `fx_system_rate`. {#S-GCConfig-getRateTable__ul_pv3_xzt_tjb} |
[Table 16. Returns]

{#S-GCConfig-getRateTable__table_ntg_knq_sjb}  
Returns the default rate table.

    var cur_config = new sn_currency.GlideCurrencyConfig();
    var curr_rate_table = cur_config.getRateTable();

Returns the rate table used for a specific FX Currency field.

    var grCurr = new GlideRecord('my_FXCurrency_table');
    var curr_field = grCurr.getElement('currency');
    var ed = curr_field.getED();
    var cur_config = new sn_currency.GlideCurrencyConfig(ed);
    var curr_rate_table = cur_config.getRateTable();

## GlideCurrencyConfig - getReferenceCurrency() {#ariaid-title11}

Returns the reference currency for an FX Currency field.
If called on an existing FX Currency field that has a corresponding FX Currency
Configuration \[fx_configuration\] record, returns the value of the Reference Currency
(reference_currency) field. Otherwise, if a new record, returns a default value.

For more information on reference currency, see [Set the reference currency](https://www.servicenow.com/docs/access?context=configure-fx-currency-field-behavior&version=xanadu&pubname=xanadu-platform-administration&ft:locale=en-US).
{#S-GCConfig-getReferenceCurrency__table_smf_qqq_sjb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 17. Parameters]

{#S-GCConfig-getReferenceCurrency__table_smf_qqq_sjb} {#S-GCConfig-getReferenceCurrency__table_tmf_qqq_sjb__entry__2}

| Type | Description |
|-|-|
| String | Reference currency as an ISO currency code. The returned value depends on the constructor used to instantiate the object. * GlideCurrencyConfig(Object ed): If an fx_configuration record exists, returns the reference_currency field from the fx_configuration record that is associated with the FX Currency field specified by the GlideElementDescriptor passed in the constructor. If no fx_configuration record, follows the GlideCurrencyConfig() rules. * GlideCurrencyConfig(): If set, returns the value of the glide.currency2.default_reference_currency system property. Otherwise the method applies the following rules, in the specified order, to determine the reference currency code: * If the glide.system.reference_currency system property is set to true, uses the value in the glide.system.reference_currency.code system property. * The value in the glide.system.locale system property (which implies a currency). * Default locale of the Java Virtual Machine on which the instance is running. {#S-GCConfig-getReferenceCurrency__ul_mjs_fd5_tjb} {#S-GCConfig-getReferenceCurrency__ul_yzw_5c5_tjb} |
[Table 18. Returns]

{#S-GCConfig-getReferenceCurrency__table_tmf_qqq_sjb}  
This code example returns the default reference currency.

    var cur_config = new sn_currency.GlideCurrencyConfig();
    var curr_reference_currency = cur_config.getReferenceCurrency();

This code example returns the reference currency for a specific FX Currency field.

    var grCurr = new GlideRecord('my_FXCurrency_table');
    var curr_field = grCurr.getElement('currency');
    var ed = curr_field.getED();
    var cur_config = new sn_currency.GlideCurrencyConfig(ed);
    var curr_reference_currency = cur_config.getReferenceCurrency();

## GlideCurrencyConfig - getReferenceCurrencySource() {#ariaid-title12}

Returns the reference currency source for an FX Currency field.
If called on an existing FX Currency field that has a corresponding FX Currency
Configuration \[fx_configuration\] record, returns the value (dot-walk path) of the Reference
Currency Source (reference_currency_source) field. Otherwise, if a new record, returns a
default value.

For more information on reference currency source, see [Set the reference currency](https://www.servicenow.com/docs/access?context=configure-fx-currency-field-behavior&version=xanadu&pubname=xanadu-platform-administration&ft:locale=en-US).
{#S-GCConfig-getReferenceCurrencySource__table_ysb_swq_sjb__entry__3}

| Name | Type | Description |
|-|-|-|
| None |   |   |
[Table 19. Parameters]

{#S-GCConfig-getReferenceCurrencySource__table_ysb_swq_sjb} {#S-GCConfig-getReferenceCurrencySource__table_zsb_swq_sjb__entry__2}

| Type | Description |
|-|-|
| String | Dot-walk path of the field used/to use as the reference currency. The returned value depends on the constructor used to instantiate the object. * GlideCurrencyConfig(Object ed): If an fx_configuration record exists, returns the reference_currency_source field from the fx_configuration record that is associated with the FX Currency field specified by the GlideElementDescriptor passed in the constructor. If no fx_configuration record, follows the GlideCurrencyConfig() rules. * GlideCurrencyConfig(): Returns `null`. |
[Table 20. Returns]

{#S-GCConfig-getReferenceCurrencySource__table_zsb_swq_sjb}  
This code example returns the default reference currency source.

    var cur_config = new sn_currency.GlideCurrencyConfig();
    var curr_reference_currency = cur_config.getReferenceCurrencySource();

This code example returns the reference currency source for a specific FX Currency
field.

    var grCurr = new GlideRecord('my_FXCurrency_table');
    var curr_field = grCurr.getElement('currency');
    var ed = curr_field.getED();
    var cur_config = new sn_currency.GlideCurrencyConfig(ed);
    var curr_reference_currency = cur_config.getReferenceCurrencySource();


