# Set and get some values in a script

Set some values in a script by using the [SetScript method](https://help.qlik.com/en-US/sense-developer/May2026/Subsystems/EngineJSONAPI/Content/service-doc-setscript.htm) and get the values of a script by using the [GetScript method](https://help.qlik.com/en-US/sense-developer/May2026/Subsystems/EngineJSONAPI/Content/service-doc-getscript.htm).

## Example

[](https://help.qlik.com/en-US/sense-developer/Subsystems/EngineAPI/Content/Sense_EngineAPI/CreatingAppLoadingData/EditDataLoadScript/set-get-script.htm)

#### The goal is to set some values in a script.

1. Set some values in the script.

The client sends:

```
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "SetScript",
  "handle": 1,
  "params": [
    "Load RecNo() as NewNumbers AutoGenerate 10;"
  ]
}
```

The engine returns:

```
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {}
}
```

The script has been updated with the new values. The script creates a table with one column and ten rows.

2. Get the script values.

The client sends:

```
{
  "jsonrpc": "2.0",
  "id": 2,
  "method": "GetScript",
  "handle": 1,
  "params": []
}
```

The engine returns:

```
{
  "jsonrpc": "2.0",
  "id": 2,
  "result": {
    "qScript": "Load RecNo() as NewNumbers AutoGenerate 10;"
  }
}
```

The script content is displayed.