# Data Fabric operations in Maestro

> Supported query prefixes and output actions for querying and updating Data Fabric records directly from BPMN task expressions in Maestro.

Maestro processes can query and update [Data Fabric](https://docs.uipath.com/data-service/automation-cloud/latest/user-guide/introduction) records directly from BPMN task expressions and output mappings. This page documents the supported query prefixes and output actions.

## Query prefixes

A query prefix in a Data Fabric expression retrieves records by field value instead of by internal record ID. Two prefixes are supported:

| Prefix | Full name | Return type | No-match behavior | Multiple-match behavior |
|--------|-----------|-------------|-------------------|-------------------------|
| `qes:` | Query Expansion Single | Single record | Returns an empty result | Returns an error |
| `qem:` | Query Expansion Multiple | Array of up to 1,000 records | Returns an empty array | Returns all matching records |

### Expression syntax

```
datafabric.EntityName["qes:FieldName=Value"].FieldToRead
datafabric.EntityName["qem:FieldName=Value"]
```

#### Example — single record lookup

```
datafabric.LoanApplicationCase["qes:CaseId=HL-999"].LoanAmount
```

#### Example — multiple record lookup

```
datafabric.LoanApplicationCase["qem:Status=Pending"]
```

### When to use each prefix

`qes:` is suited for lookups where exactly one record is expected. When the query matches more than one record, Maestro returns an error and the workflow stops. When no record is found, Maestro returns an empty result and continues execution.

`qem:` is suited for queries that may return more than one record. Maestro returns an array of up to 1,000 matching records. A process can iterate over the array using a multi-instance marker or a loop, enabling fan-out patterns across multiple Data Fabric records in a single step.

:::note
When migrating expressions from `qes:` to `qem:`, update downstream variable references. `qes:` returns a single record object; `qem:` returns an array.
:::

## Output actions

BPMN task outputs that target a Data Fabric entity support three actions. The action determines whether the output inserts a new record, modifies an existing one, or does both depending on whether a matching record exists.

| Action | Behavior | Record must exist |
|--------|----------|------------------|
| `create` | Inserts a new record | No |
| `update` | Modifies an existing record identified by record ID | Yes |
| `upsert` | Inserts a new record if no match is found; updates the existing record if a match is found | No |

The output action is configured in the **Output** section of the task properties panel. For more information about the properties panel, see [Configuring properties and data](https://docs.uipath.com/data-service/automation-cloud/latest/user-guide/properties-panel).

## Related pages

- [Integrating systems and data](https://docs.uipath.com/data-service/automation-cloud/latest/user-guide/integrating-systems-and-data)
- [Working with files in Maestro processes](https://docs.uipath.com/data-service/automation-cloud/latest/user-guide/working-with-files-in-maestro-processes)
- [Variables and Expression editor](https://docs.uipath.com/data-service/automation-cloud/latest/user-guide/variables-and-expression-editor)
- [Configuring properties and data](https://docs.uipath.com/data-service/automation-cloud/latest/user-guide/properties-panel)
