# Property Dataset Context

Property Editors UIs require a Dataset Context to be present for them to work. This enables Property Editor UIs to have a generic relationship with their ownership and work in various cases.

The Dataset Context holds a name for the entity and a set of property values.

Retrieve a reference to the Property Dataset Context to start communicating:

```typescript
this.consumeContext(UMB_PROPERTY_DATASET_CONTEXT, async (context) => {
    ...
});
```

### Observe the value of another Property

Observe a value if you are using it in your UI. In the following example, the \`alias\` is used to retrieve the value of another property:

```typescript
this.consumeContext(UMB_PROPERTY_DATASET_CONTEXT, async (context) => {
    this.observe(
        await context?.propertyValueByAlias("alias-of-other-property"),
        (value) => {
            console.log("the value of the other property", value)
        }
    );
});
```

### Set the value of another Property

You can alter the value of another property in this way:

```typescript
this.consumeContext(UMB_PROPERTY_DATASET_CONTEXT, async (context) => {
    this.datasetContext = context;
});

...

updateValue() {
    this.datasetContext?.setPropertyValue("alias-of-other-property", "The updated value");
}
```

### Dataset Context in relation to Property Editors and Workspaces

A Dataset Context is the connection point between a Property Editor and a Workspace.

The Workspace has the root ownership, where the Dataset represents a specific Variant.

The hierarchy is as follows:

* Workspace Context
  * Property Dataset Context
    * Property Editor UIs

If you want to set or read values from properties of the same variant, use the Property Dataset Context. If you need values from another variant, use the Workspace Context instead.


---

# 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://docs.umbraco.com/umbraco-cms/18.latest/extend-your-project/backoffice-extensions/contexts/property-dataset-context.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.
