# In-Memory DB Functions

In-Memory DB Functions are used to write/read objects to the memory zone.

## Get Object <a href="#get-object" id="get-object"></a>

#### Object ins.getGlobalObject(String name) <a href="#object-ins-getglobalobject-string-name" id="object-ins-getglobalobject-string-name"></a>

Reads an object in memory.

name : Name of the object.

Return Value: Returns a JSON object.

#### Syntax

```javascript
var obj=ins.getGlobalObject("My_Obj");
if (obj!==null) {
  var item="Previous_Value";
    if (obj[item]!==null) {
      ins.notify("info","Get Global Object",obj[item]);
   }
}
return obj[item];
```

## Set Object <a href="#set-object" id="set-object"></a>

#### Object ins.setGlobalObject(String name) <a href="#object-ins-setglobalobject-string-name" id="object-ins-setglobalobject-string-name"></a>

Writes an object to memory.

name: Object name.

Return Value: Does not return any value.

#### Syntax

```javascript
var My_Obj={};
My_Obj.Previous_Value=0;
My_Obj.Message="Hello World";
ins.setGlobalObject("My_Obj",My_Obj);
```


---

# 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://inscada.gitbook.io/ins/en-1/programing/apis/in-memory-db-functions.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.
