---
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


---

# NameValuePairs - Global

# NameValuePairs - Global {#ariaid-title1}

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

The NameValuePairs script include provides methods to convert between maps and strings representing the name/value pairs in the map.

The string form is: `<name> = <value>, <name> = <value, ...` where `<name>` is a string name, optionally surrounded by double quotes (Microsoft-style), and `<value>` is a string value,
also optionally surrounded by double quotes.  
The following are all examples of valid name/value strings:

* `name = value`
* `name = "My Value", name = value`
* `"My Name = this" = "My Value", "My Value, all the time", name = value`
* `"My Name" = "This" "name""", name = value`
{#c_NameValuePairsAPI__ul_utm_d3r_pt}In the third example, the quoted values contain equals and commas. In the fourth example, the quoted value contains a quote.  
Instances have the following properties initialized:

* map: The map (JavaScript object being used as a hashmap) form of the name/value pairs, with Microsoft-style quotes removed
* string: The string form of the name/value pairs, with Microsoft-style quoting.
{#c_NameValuePairsAPI__ul_etr_l3r_pt}

Use with any server-side script where you need convert name/value pairs between maps and
strings.

## NameValuePairs - NameValuePairs(String stringForm) {#ariaid-title2}

Creates an instance of the class initialized with the specified string.
{#r_NVP-NameValuePairs_S__table_ehc_vjr_pt__entry__3}

| Name | Type | Description |
|-|-|-|
| stringForm | String | The values to use when creating the object. |
[Table 1. Parameters]

{#r_NVP-NameValuePairs_S__table_ehc_vjr_pt}

## NameValuePairs - NameValuePairs(Object mapForm) {#ariaid-title3}

Creates an instance of the class initialized with the specified hash map.
{#r_NVP-NameValuePairs_O__table_atb_kkr_pt__entry__3}

| Name | Type | Description |
|-|-|-|
| mapForm | Object | The map to use when creating the object. |
[Table 2. Parameters]

{#r_NVP-NameValuePairs_O__table_atb_kkr_pt}

## NameValuePairs - mapToString() {#ariaid-title4}

Produces `this.string` from `this.map`.
{#r_NVP-mapToString__table_qlm_1lr_pt__entry__3}

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

{#r_NVP-mapToString__table_qlm_1lr_pt} {#r_NVP-mapToString__table_rlm_1lr_pt__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 4. Returns]

{#r_NVP-mapToString__table_rlm_1lr_pt}

## NameValuePairs - quotify(Object value) {#ariaid-title5}

If the specified value contains double quotes, equals, commas, or spaces, this method
surrounds the value with double quotes and doubles up any enclosed double quotes.
{#r_NVP-quotify_O__table_ogr_vlr_pt__entry__3}

| Name | Type | Description |
|-|-|-|
| value | Object | The value to process |
[Table 5. Parameters]

{#r_NVP-quotify_O__table_ogr_vlr_pt} {#r_NVP-quotify_O__table_pgr_vlr_pt__entry__2}

| Type | Description |
|-|-|
| String | The value with added quotes. |
[Table 6. Returns]

{#r_NVP-quotify_O__table_pgr_vlr_pt}

## NameValuePairs - stringToMap() {#ariaid-title6}

Produces `this.map` from `this.string`.
{#r_NVP-stringToMap__table_xtm_mlr_pt__entry__3}

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

{#r_NVP-stringToMap__table_xtm_mlr_pt} {#r_NVP-stringToMap__table_ytm_mlr_pt__entry__2}

| Type | Description |
|-|-|
| void |   |
[Table 8. Returns]

{#r_NVP-stringToMap__table_ytm_mlr_pt}

