{"revision":"c10276e953456835cdbb1f3a60d58ae1980be353","document":{"id":1068,"path":"api-reference/server-api-reference/c_NameValuePairsAPI.md","title":"NameValuePairs - Global","bundle":null,"doc_type":null,"release":"australia","body":"\n# NameValuePairs- Global\n\nThe NameValuePairs script include provides methods to convert between maps and strings representing the name/value pairs in the map.\n\nThe 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.\n\nThe following are all examples of valid name/value strings:\n\n-   `name = value`\n-   `name = \"My Value\", name = value`\n-   `\"My Name = this\" = \"My Value\", \"My Value, all the time\", name = value`\n-   `\"My Name\" = \"This\" \"name\"\"\", name = value`\n\nIn the third example, the quoted values contain equals and commas. In the fourth example, the quoted value contains a quote.\n\nInstances have the following properties initialized:\n\n-   map: The map \\(JavaScript object being used as a hashmap\\) form of the name/value pairs, with Microsoft-style quotes removed\n-   string: The string form of the name/value pairs, with Microsoft-style quoting.\n\nUse with any server-side script where you need convert name/value pairs between maps and strings.\n\n**Parent Topic:**[Server API reference](https://raw.githubusercontent.com/ServiceNow/ServiceNowDocs/australia/markdown/australia/api-reference/server-api-reference/api-server.md)\n\n## NameValuePairs - NameValuePairs\\(String stringForm\\)\n\nCreates an instance of the class initialized with the specified string.\n\n|Name|Type|Description|\n|----|----|-----------|\n|stringForm|String|The values to use when creating the object.|\n\n## NameValuePairs - NameValuePairs\\(Object mapForm\\)\n\nCreates an instance of the class initialized with the specified hash map.\n\n|Name|Type|Description|\n|----|----|-----------|\n|mapForm|Object|The map to use when creating the object.|\n\n## NameValuePairs - mapToString\\(\\)\n\nProduces `this.string` from `this.map`.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n## NameValuePairs - quotify\\(Object value\\)\n\nIf 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.\n\n|Name|Type|Description|\n|----|----|-----------|\n|value|Object|The value to process|\n\n|Type|Description|\n|----|-----------|\n|String|The value with added quotes.|\n\n## NameValuePairs - stringToMap\\(\\)\n\nProduces `this.map` from `this.string`.\n\n|Name|Type|Description|\n|----|----|-----------|\n|None| | |\n\n|Type|Description|\n|----|-----------|\n|void| |\n\n"}}