> For the complete documentation index, see [llms.txt](https://boxlang.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structclear.md).

# StructClear

Clear all items from struct

## Method Signature

```
StructClear(structure=[modifiableStruct])
```

### Arguments

| Argument    | Type               | Required | Description          | Default |
| ----------- | ------------------ | -------- | -------------------- | ------- |
| `structure` | `modifiableStruct` | `true`   | The struct to clear. |         |

## Examples

### Script Syntax

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

```java
profile = { 
	NAME : "John",
	INSTRUMENT : "guitar",
	OCCUPATION : "singer"
};
structClear( profile );
writeOutput( JSONSerialize( profile ) );

```

Result: An empty struct

### Tag Syntax

```java
<bx:set profile = { 
	NAME : "John",
	INSTRUMENT : "guitar",
	OCCUPATION : "singer"
	} >
<bx:set structClear( profile ) >
<bx:dump var="#profile#"/>
```

Result: An empty struct

### Additional Examples

[Run Example](https://try.boxlang.io/?code=eJxljs0KwjAQhM%2FNUww5tRDoXelBIognhR48ryVqMD8lTRUR311NezB4Wr7ZnZklpy2ZAQ2eYIXcHbAAt95zwYr9dvMlr92Vs9eS1TXai7%2BjG0NQLoImL1uPti9h6KhMw2W%2B5AI3Cs1MqFKKNIoChhjGLrJpJKlEfpfaZknAfUDZPj7ywtVsoVNUAR0Zo90Z7U9q9f%2FEG64LUEQ%3D)

```java
animals = { 
	COW : "moo",
	PIG : "oink"
};
// Show current animals
Dump( label="Current animals", var=animals );
// Clear struct
structClear( animals );
// Show animals, now empty
Dump( label="Animals after calling StructClear()", var=animals );

```

## Related

* [StructAppend](/boxlang-language/reference/built-in-functions/struct/structappend.md)
* [StructCopy](/boxlang-language/reference/built-in-functions/struct/structcopy.md)
* [StructDelete](/boxlang-language/reference/built-in-functions/struct/structdelete.md)
* [StructEach](/boxlang-language/reference/built-in-functions/struct/structeach.md)
* [StructEquals](/boxlang-language/reference/built-in-functions/struct/structequals.md)
* [StructEvery](/boxlang-language/reference/built-in-functions/struct/structevery.md)
* [StructFilter](/boxlang-language/reference/built-in-functions/struct/structfilter.md)
* [StructFind](/boxlang-language/reference/built-in-functions/struct/structfind.md)
* [StructFindKey](/boxlang-language/reference/built-in-functions/struct/structfindkey.md)
* [StructFindValue](/boxlang-language/reference/built-in-functions/struct/structfindvalue.md)
* [StructGet](/boxlang-language/reference/built-in-functions/struct/structget.md)
* [StructGetMetadata](/boxlang-language/reference/built-in-functions/struct/structgetmetadata.md)
* [StructInsert](/boxlang-language/reference/built-in-functions/struct/structinsert.md)
* [StructIsCaseSensitive](/boxlang-language/reference/built-in-functions/struct/structiscasesensitive.md)
* [StructIsOrdered](/boxlang-language/reference/built-in-functions/struct/structisordered.md)
* [StructKeyArray](/boxlang-language/reference/built-in-functions/struct/structkeyarray.md)
* [StructKeyExists](/boxlang-language/reference/built-in-functions/struct/structkeyexists.md)
* [StructKeyList](/boxlang-language/reference/built-in-functions/struct/structkeylist.md)
* [StructKeyTranslate](/boxlang-language/reference/built-in-functions/struct/structkeytranslate.md)
* [StructMap](/boxlang-language/reference/built-in-functions/struct/structmap.md)
* [StructNew](/boxlang-language/reference/built-in-functions/struct/structnew.md)
* [StructNone](/boxlang-language/reference/built-in-functions/struct/structnone.md)
* [StructReduce](/boxlang-language/reference/built-in-functions/struct/structreduce.md)
* [StructSome](/boxlang-language/reference/built-in-functions/struct/structsome.md)
* [StructSort](/boxlang-language/reference/built-in-functions/struct/structsort.md)
* [StructToQueryString](/boxlang-language/reference/built-in-functions/struct/structtoquerystring.md)
* [StructToSorted](/boxlang-language/reference/built-in-functions/struct/structtosorted.md)
* [StructUpdate](/boxlang-language/reference/built-in-functions/struct/structupdate.md)
* [StructValueArray](/boxlang-language/reference/built-in-functions/struct/structvaluearray.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://boxlang.ortusbooks.com/boxlang-language/reference/built-in-functions/struct/structclear.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
