> For the complete documentation index, see [llms.txt](https://docs.apica.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apica.io/platform-docs/test-data-orchestrator-tdo/user-documentation/tdo-project-builder-user-guide/create-data-views/locking-records-in-a-data-view.md).

# Locking Records in a Data View

TDO will automatically select the first available record that matches the join criteria in the data views unless you 'Lock' the records.

A Lock will prevent data reuse and will assign each record in the locked data block only once.  To re-use the data in the data block, you will have to remove the lock and run data assembly once, then put the lock back on.  To replace the data in the data block with a new file, see 'Editing Data Source in a Data View'.

A Lock can be placed when creating a data view or can be done later by editing the data view. &#x20;

{% hint style="info" %}
If you are in the build phase, it is recommended that you do not set the Lock until you have completed creating and testing your data assembly rules.  Using the Lock feature during testing will result in test data getting 'used' during the rule development phase.
{% endhint %}

To edit the data view, hover to the right of the data view name and click on the blue pencil icon.  The 'Edit Data View' window will open.  Below the 'Criteria' section is a list of the fields in the source data block.  To the right of the field names is a column with the header 'Locked'.  To lock this file by account number, we have checked the 'Locked' box next to the 'account\_num' field.  This will ensure that each account number is used only once.  Click the 'Save' button to save the lock on the data view.

<figure><img src="/files/IUlnOMeJaCmsaF77R7Ez" alt=""><figcaption><p>Data view with data lock set</p></figcaption></figure>


---

# 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://docs.apica.io/platform-docs/test-data-orchestrator-tdo/user-documentation/tdo-project-builder-user-guide/create-data-views/locking-records-in-a-data-view.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.
