> For the complete documentation index, see [llms.txt](https://docs.rulecube.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rulecube.com/v2.5/how-to-guides/ruleset-development/entities/entity-instantiation.md).

# Entity instantiation

Anywhere in code (functions, rules, calculated properties), you can create new entities on the fly. For instance, when you have an Entity named 'Person', you can create an instance like this: `new Person()`

A few examples:

```js
// Inside a Function
let person = new Person();
person.FirstName = "John";
person.LastName = "Doe"
return person;
```

alternatively:

```js
let person = new Person({ FirstName: "John", LastName: "Doe"});
return person;
```

Calculated properties work as expected. Assuming Person has a calculated property named 'FullName' that combines the first and last name properties:

```js
let person = new Person({ FirstName: "John", LastName: "Doe"});
return person.FullName; // "John Doe"
```


---

# 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:

```
GET https://docs.rulecube.com/v2.5/how-to-guides/ruleset-development/entities/entity-instantiation.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.
