# Object

## Introduction

The Object library in Autom Mate provides actions designed to work with data and functions encapsulated within objects. An object, in the context of this library, contains both data and its associated functionality.

The purpose of the Object library is to offer operations that manipulate and interact with objects, allowing users to manage data structures effectively.

## What is Object?

The Object component consists of actions tailored for handling operations related to objects. It includes actions such as appending new data to objects, creating new objects, converting XML data to objects, and searching for specific data within objects.

#### Key Features

* <mark style="color:orange;">**Append**</mark><mark style="color:orange;">:</mark>
  * <mark style="color:orange;">Add new data or properties to an object.</mark>
* <mark style="color:orange;">**Assign**</mark><mark style="color:orange;">:</mark>
  * <mark style="color:orange;">Create a new object with specified data and properties.</mark>
* <mark style="color:orange;">**Convert "XML" to Object**</mark><mark style="color:orange;">:</mark>
  * <mark style="color:orange;">Transform XML-formatted data into an object for easy accessibility.</mark>
* <mark style="color:orange;">**Search**</mark><mark style="color:orange;">:</mark>
  * <mark style="color:orange;">Locate specific data within an object using various search criteria.</mark>

## How To Use Action

### Append

<figure><img src="/files/VBCDkeogJhChf2iu8SZX" alt=""><figcaption></figcaption></figure>

**Description:** The **Append** action adds new data or properties to an object, extending its functionality.

**Usage:**

1. **Object Variable**:
   * <mark style="color:green;">Select the object variable to which new data will be appended.</mark>
2. **Data to Append**:
   * <mark style="color:green;">Add new data to the object.</mark>
   * <mark style="color:green;">Usage patterns are provided as examples.</mark>
   * <mark style="color:green;">Data is filled into the object using quotation marks between the</mark> <mark style="color:green;">**`[ ]`**</mark> <mark style="color:green;">brackets.</mark>

### Assign

<figure><img src="/files/RoDYo7Th5mNrGyg50zJU" alt=""><figcaption></figcaption></figure>

**Description:** The **Assign** action is used to create a new object with specified data and properties.

**Usage:**

1. **Object Variable**:
   * <mark style="color:green;">Provide a name for the new object variable.</mark>
   * <mark style="color:green;">Select an existing object type variable or create a new one.</mark>
2. **Variable**:
   * <mark style="color:green;">Fill the object variable with data.</mark>
   * <mark style="color:green;">Use quotation marks for string data.</mark>
   * <mark style="color:green;">Numeric data can be added without quotation marks.</mark>

### Convert "XML" To Object

<figure><img src="/files/WwNDCvCns7OwdlsOKRg7" alt=""><figcaption></figcaption></figure>

**Description:** The **Convert "XML" to Object** action transforms XML data into an object or data structure for easier integration and manipulation.

**Usage:**

1. **Input XML**:
   * <mark style="color:green;">Define your XML data either as a file path or manually.</mark>
   * <mark style="color:green;">Select 'manual input' to write XML data directly.</mark>

### Search

<figure><img src="/files/7urbQ2LBonYH4DsSLf1t" alt=""><figcaption></figcaption></figure>

**Description:** The **Search** action allows users to search for specific data within an object using various filters.

**Usage:**

1. **Object Array**:
   * <mark style="color:green;">Provide the object or array to search within.</mark>
2. **Add Filter**:
   * <mark style="color:green;">Specify the key, operator, and value for the search.</mark>
   * <mark style="color:green;">Available operators include "is equal to," "is not equal to," "is empty," "is not empty," "has property," and "contains."</mark>
3. **Case Sensitive**:
   * <mark style="color:green;">Enable to perform a case-sensitive search, considering exact case matches.</mark>

### **Remove Keys**

#### **Description and Purpose**

The **Remove Keys** action enables Autom Mate users to remove one or more specified keys from an existing JSON object variable within their workflows. This action is useful for filtering out unnecessary or sensitive data fields before further processing or storage.

By providing the source object and the keys to remove, users can efficiently clean or customize their data structures dynamically.

***

#### **Usage Instructions**

{% stepper %}
{% step %}
&#x20;**Provide Source Object**

**Source Object**: Select or provide the JSON object variable from which keys should be removed.\
Example: `##obj##` or `##xObjectVariable[user]##`
{% endstep %}

{% step %}
**Specify Keys to Remove**

**Keys**: Enter the keys you want to remove from the source object. Enter each key individually and press Enter after each one.<br>

Example:

* `key1`
* `password`
* `metadata`
  {% endstep %}

{% step %}
**Assign Resulting Object Variable**

**Assign the removed keys to variable**: Choose an object-type variable (e.g., `resp`) to store the resulting object after keys have been removed.
{% endstep %}

{% step %}
**Execute and Review**

Run the flow. After execution, the output variable will contain the source object minus the specified keys.
{% endstep %}
{% endstepper %}

***

#### **Inputs**

| Field               | Description                                                                           |
| ------------------- | ------------------------------------------------------------------------------------- |
| **Source Object**   | The JSON object variable to modify (required). Example: `##obj##`.                    |
| **Keys**            | The list of keys to delete from the source object (required). Enter one key per line. |
| **Output Variable** | An object-type variable to store the resulting filtered object (required).            |

***

#### **Outputs**

| Field               | Description                                               |
| ------------------- | --------------------------------------------------------- |
| **Output Variable** | The filtered JSON object with the specified keys removed. |

***

#### **Example Response**

```json
{
  "key2": [],
  "key3": {}
}
```

*If `key1` was removed from the original object:*

```json
{
  "key1": "test",
  "key2": [],
  "key3": {}
}
```

***

## Additional Tips

### [**Use Cases**](/userguide/use-cases.md)

### [FAQ](/userguide/faq.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.autommate.com/userguide/libraries/transform/object.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
