# SaveContent

I capture the generated content from the body statements and save it into a variable

## Component Signature

```
<bx:SaveContent variable=[string]
trim=[boolean]
append=[boolean] />
```

### Attributes

| Atrribute  | Type      | Required | Description | Default |
| ---------- | --------- | -------- | ----------- | ------- |
| `variable` | `string`  | `true`   |             |         |
| `trim`     | `boolean` | `false`  |             | `false` |
| `append`   | `boolean` | `false`  |             | `false` |

## Examples

### Script Syntax

[Run Example](https://try.boxlang.io/?code=eJxLqrAqTixLTc7PK0nNK1EoSyzKTEzKSbVVyq10hogpKVRzcZYXZZak%2BpeWFJSWaCgoBefnwnToKSloWnPVcgEA0RIZLw%3D%3D)

```java
bx:savecontent variable="myContent" {
	writeOutput( "Somecontent." );
}

```

### Tag Syntax

```java
<bx:savecontent variable="myContent">
<bx:output>Some content.</bx:output>
</bx:savecontent>
```


---

# 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://boxlang.ortusbooks.com/boxlang-language/reference/components/system/savecontent.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.
