---
sourceDocument: Australia Workflow Data Fabric
sourceDocumentLink: https://www.servicenow.com/docs/r/australia/integrate-applications

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia Workflow Data Fabric

ft:clusterId :

    - crint

bundleId :

    - crint

workflow :

    - Creator


---

# KeyValuePair connector methods

# KeyValuePair connector methods {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 5 minutes to read
Summarize  
![AI sparkle icon](https://servicenow.com/docs/portal-asset/ai-sparkle-icon) Summarized using AI  
This content was generated using new OpenAI-powered functionality. Results are provided on an as is basis and are not guaranteed to be accurate or complete.  

## Summary of KeyValuePair Connector Methods

The KeyValuePair connector methods allow users to manage key-value pairs within automation flows in ServiceNow.
By exposing these methods, customers can efficiently add, retrieve, update, and delete key-value pairs as part of their automation processes.
Show full answer Show less  

## Key Features

* **Add:** Add a key-value pair, with an option to ignore duplicates.
* **Clear:** Remove all key-value pairs from the system.
* **ContainsKey:** Check if a specified key exists.
* **ContainsValue:** Verify if a specified value exists for a key.
* **Count:** Retrieve the total number of key-value pairs.
* **Delete:** Remove a specific key and its associated value.
* **GetItem:** Obtain the value associated with a specified key.
* **GetItems:** Retrieve values for multiple keys after configuration.
* **GetItemsByIndex:** Access key values based on their indexes after configuration.
* **ParseFromText:** Parse a text input into multiple key-value pairs, with optional clearing of existing pairs.
* **SetItem:** Update the value of an existing key.
* **SetItems:** Update values for multiple keys after configuration.
* **SetItemsByIndex:** Update values based on specified indexes after configuration.
* **ToJSON:** Convert key-value pairs into JSON format.
* **ToText:** Render key-value pairs into text format, with an option to show only values.

## Key Outcomes

By utilizing these methods, ServiceNow customers can streamline their data management processes within automation flows. They can efficiently manipulate key-value pairs, ensuring that their automation tasks are more effective and responsive to business needs. The ability to parse text inputs and convert data formats enhances flexibility in integrating with other systems and processes.  
The Keyvalue pair connector methods perform various actions on key value pairs. In an
automation flow, the methods are connected with other methods and components. To use the
methods, you must first expose them.

## Add {#keyvaluepair-connector-methods__section_gcb_ftx_4tb}

Adds a keyvalue pair.

To provide inputs to the parameters, see [Configure port properties](https://www.servicenow.com/docs/o6fErdzBCUqYUWlLG1ZZzQ "Configure how data is passed to the input fields of a component or method in RPA Desktop Design Studio.").  
{#keyvaluepair-connector-methods__table_l1y_t4r_4tb__entry__6}

| Parameter | Description | Data port type | Data type | Default value | Mandatory? |
|-|-|-|-|-|-|
| Key | Name of the key. | Data in | String | None | Yes |
| Value | Value of the key. | Data in | Object | None | Yes |
| IgnoreDuplicates | If the value is True, the method ignores a duplicate key. Else, if the value is False, the method returns an error message. | Data in | Boolean | None | No |
[Table 1. Add method parameters]

{#keyvaluepair-connector-methods__table_l1y_t4r_4tb}

## Clear {#keyvaluepair-connector-methods__section_dfq_k5x_4tb}

Clears all keyvalue pairs.

## ContainsKey {#keyvaluepair-connector-methods__section_ips_kvx_4tb}

Returns True if the specified key exists, else, returns False.

To provide inputs to the parameters, see [Configure port properties](https://www.servicenow.com/docs/o6fErdzBCUqYUWlLG1ZZzQ "Configure how data is passed to the input fields of a component or method in RPA Desktop Design Studio.").  
{#keyvaluepair-connector-methods__table_x4r_svx_4tb__entry__6}

| Parameter | Description | Data port type | Data type | Default value | Mandatory? |
|-|-|-|-|-|-|
| Key | Name of the key. | Data in | String | None | Yes |
| Return | Returns True if the specified key exists, else, returns False. | Data out | Boolean | Not applicable | Not applicable |
[Table 2. ContainsKey method parameters]

{#keyvaluepair-connector-methods__table_x4r_svx_4tb}

## ContainsValue {#keyvaluepair-connector-methods__section_h14_cwx_4tb}

Returns True if the specified key value exists, else, returns False.

To provide inputs to the parameters, see [Configure port properties](https://www.servicenow.com/docs/o6fErdzBCUqYUWlLG1ZZzQ "Configure how data is passed to the input fields of a component or method in RPA Desktop Design Studio.").  
{#keyvaluepair-connector-methods__table_wbh_twx_4tb__entry__6}

| Parameter | Description | Data port type | Data type | Default value | Mandatory? |
|-|-|-|-|-|-|
| Value | Name of the key value. | Data in | String | None | Yes |
| Return | Returns True if the specified key value exists, else, returns False. | Data out | Boolean | Not applicable | Not applicable |
[Table 3. ContainsValue method parameters]

{#keyvaluepair-connector-methods__table_wbh_twx_4tb}

## Count {#keyvaluepair-connector-methods__section_odt_xwx_4tb}

Returns the total count of keyvalue pairs.  
{#keyvaluepair-connector-methods__table_p3f_bxx_4tb__entry__6}

| Parameter | Description | Data port type | Data type | Default value | Mandatory? |
|-|-|-|-|-|-|
| Return | Returns the total count of keyvalue pairs. | Data out | Integer | Not applicable | Not applicable |
[Table 4. Count method parameters]

{#keyvaluepair-connector-methods__table_p3f_bxx_4tb}

## Delete {#keyvaluepair-connector-methods__section_knr_qxx_4tb}

Removes the specified key.

To provide inputs to the parameters, see [Configure port properties](https://www.servicenow.com/docs/o6fErdzBCUqYUWlLG1ZZzQ "Configure how data is passed to the input fields of a component or method in RPA Desktop Design Studio.").  
{#keyvaluepair-connector-methods__table_php_txx_4tb__entry__6}

| Parameter | Description | Data port type | Data type | Default value | Mandatory? |
|-|-|-|-|-|-|
| Key | Name of the key. | Data in | String | None | Yes |
[Table 5. Delete method parameters]

{#keyvaluepair-connector-methods__table_php_txx_4tb}

## GetItem {#keyvaluepair-connector-methods__section_ush_1yx_4tb}

Returns the value of the specified key.

To provide inputs to the parameters, see [Configure port properties](https://www.servicenow.com/docs/o6fErdzBCUqYUWlLG1ZZzQ "Configure how data is passed to the input fields of a component or method in RPA Desktop Design Studio.").  
{#keyvaluepair-connector-methods__table_rjd_2yx_4tb__entry__6}

| Parameter | Description | Data port type | Data type | Default value | Mandatory? |
|-|-|-|-|-|-|
| Key | Name of the key. | Data in | String | None | Yes |
| Return | Returns the value of the key. | Data out | Object | Not applicable | Not applicable |
[Table 6. GetItem method parameters]

{#keyvaluepair-connector-methods__table_rjd_2yx_4tb}

## GetItems {#keyvaluepair-connector-methods__section_nkm_4yx_4tb}

Returns the values of multiple keys. You must first configure the keys in the method.  
To configure, do the following steps.

1. Click the method settings icon (![Method settings icon.]()).
2. Click the add keys icon (![Add keys icon.]()).
3. Enter the key name.
4. Update the key data type from the list.
5. Repeat the steps to set multiple key names.
6. Click OK.

   A Data out port is created with each key name you
   set.
{#keyvaluepair-connector-methods__ol_dsq_nzx_4tb}  
{#keyvaluepair-connector-methods__table_k22_21y_4tb__entry__6}

| Parameter | Description | Data port type | Data type | Default value | Mandatory? |
|-|-|-|-|-|-|
| Key | Returns the value of the key. | Data out | Object | Not applicable | Not applicable |
[Table 7. GetItems method parameters]

{#keyvaluepair-connector-methods__table_k22_21y_4tb}

## GetItemsByIndex {#keyvaluepair-connector-methods__section_of3_41y_4tb}

Returns the key values based on their index. You must first configure the indexes in the
method.  
To configure, do the following steps.

1. Click the method settings icon (![Method settings icon.]()).
2. Click the add indexes icon (![Add keys icon.]()).
3. Enter the key index.
4. Update the key data type from the list.
5. Repeat the steps to set multiple key indexes.
6. Click OK.

   A Data out port is created with each key index you
   set.
{#keyvaluepair-connector-methods__ol_e1y_bby_4tb}  
{#keyvaluepair-connector-methods__table_irj_mby_4tb__entry__6}

| Parameter | Description | Data port type | Data type | Default value | Mandatory? |
|-|-|-|-|-|-|
| Key index | Returns the value of the key. | Data out | Object | Not applicable | Not applicable |
[Table 8. GetItemsByIndex method parameters]

{#keyvaluepair-connector-methods__table_irj_mby_4tb}

## ParseFromText {#keyvaluepair-connector-methods__section_jbj_fly_4tb}

Parses the specified text into key value pairs. It can create multiple keyvalue pairs.

To provide inputs to the parameters, see [Configure port properties](https://www.servicenow.com/docs/o6fErdzBCUqYUWlLG1ZZzQ "Configure how data is passed to the input fields of a component or method in RPA Desktop Design Studio.").  
{#keyvaluepair-connector-methods__table_vs2_xly_4tb__entry__6}

| Parameter | Description | Data port type | Data type | Default value | Mandatory? |
|-|-|-|-|-|-|
| Text | Text comprising the keys and values that the method parses. | Data in | String | None | Yes |
| ItemSeparator | Separator between two keyvalue pairs. | Data in | String | None | Yes |
| KeyValueSeparator | Separator between the key and its value. | Data in | String | None | Yes |
| ClearBeforeParse | If True, clears any existing keyvalue pair before parsing. | Data in | Boolean | None | No |
[Table 9. ParseFromText method parameters]

{#keyvaluepair-connector-methods__table_vs2_xly_4tb}

## Reverse {#keyvaluepair-connector-methods__section_oyx_mny_4tb}

Reverses the key indexes.  
Tip:  
After executing the method, you can see the output by executing the GetItemsByIndex method.

## SetData {#keyvaluepair-connector-methods__section_o1v_try_4tb}

Need information.

## SetItem {#keyvaluepair-connector-methods__section_a5c_vry_4tb}

Updates the value of a key.

To provide inputs to the parameters, see [Configure port properties](https://www.servicenow.com/docs/o6fErdzBCUqYUWlLG1ZZzQ "Configure how data is passed to the input fields of a component or method in RPA Desktop Design Studio.").  
{#keyvaluepair-connector-methods__table_v4f_dsy_4tb__entry__6}

| Parameter | Description | Data port type | Data type | Default value | Mandatory? |
|-|-|-|-|-|-|
| Key | Name of the key. | Data in | String | None | Yes |
| Value | Updated value of the key. | Data in | Object | None | Yes |
[Table 10. SetItem method parameters]

{#keyvaluepair-connector-methods__table_v4f_dsy_4tb}  
Tip:  
Test the updated value by executing the GetItemsByIndex method.

## SetItems {#keyvaluepair-connector-methods__section_il5_jsy_4tb}

Updates the values of the specified keys. You must first configure the keys in the
method.  
To configure the keys, do the following steps.

1. Click the method settings icon (![Method settings icon.]()).
2. Click the add keys icon (![Add keys icon.]()).
3. Enter the key name.
4. Update the key data type from the list.
5. Repeat the steps to set multiple key names.
6. Click OK.

   A Data in port is created with each key name you
   set.
{#keyvaluepair-connector-methods__ol_epq_tsy_4tb}

To provide inputs to the parameters, see [Configure port properties](https://www.servicenow.com/docs/o6fErdzBCUqYUWlLG1ZZzQ "Configure how data is passed to the input fields of a component or method in RPA Desktop Design Studio.").  
{#keyvaluepair-connector-methods__table_ug5_zsy_4tb__entry__6}

| Parameter | Description | Data port type | Data type | Default value | Mandatory? |
|-|-|-|-|-|-|
| Key | Updated value of the key. | Data in | Object | None | Yes |
[Table 11. SetItems method parameters]

{#keyvaluepair-connector-methods__table_ug5_zsy_4tb}  
Tip:  
Test the updated value by executing the GetItemsByIndex method.

## SetItemsByIndex {#keyvaluepair-connector-methods__section_t3c_sty_4tb}

Updates the values of the keys based on the specified indexes. You must first configure the
indexes in the method.  
To configure the indexes, do the following steps.

1. Click the method settings icon (![Method settings icon.]()).
2. Click the add indexes icon (![Add keys icon.]()).
3. Enter the key index.
4. Update the key data type from the list.
5. Repeat the steps to set multiple key indexes.
6. Click OK.

   A Data in port is created with each key index you
   set.
{#keyvaluepair-connector-methods__ol_izp_m5y_4tb}  
{#keyvaluepair-connector-methods__table_emr_p5y_4tb__entry__6}

| Parameter | Description | Data port type | Data type | Default value | Mandatory? |
|-|-|-|-|-|-|
| Key Index | Index of the key. | Data in | Object | None | Yes |
[Table 12. SetItemsByIndex method parameters]

{#keyvaluepair-connector-methods__table_emr_p5y_4tb}  
Tip:  
Test the updated value by executing the GetItemsByIndex method.

## ToJSON {#keyvaluepair-connector-methods__section_nds_gvy_4tb}

Renders the keyvalue pairs to the JSON format.

## ToText {#keyvaluepair-connector-methods__section_pnh_4vy_4tb}

Renders the keyvalue pairs to the text format.

To provide inputs to the parameters, see [Configure port properties](https://www.servicenow.com/docs/o6fErdzBCUqYUWlLG1ZZzQ "Configure how data is passed to the input fields of a component or method in RPA Desktop Design Studio.").  
{#keyvaluepair-connector-methods__table_xsf_vvy_4tb__entry__6}

| Parameter | Description | Data port type | Data type | Default value | Mandatory? |
|-|-|-|-|-|-|
| ValuesOnly | If True, the method renders only the values of the keys, else, renders the keyvalue pair. | Data in | Boolean | None | No |
| Return | Returns the keyvalue pair to the text format. | Data out | String | Not applicable | Not applicable |
[Table 13. ToText method parameters]

{#keyvaluepair-connector-methods__table_xsf_vvy_4tb}

