---
url: /flow/guide/scripting-reference/classes/data-set/dataset.prior.md
---

# Dataset.Prior

## Declaration

`procedure Prior;`

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
begin
  while not DATASET.BOF do
begin
LogInfo('Do something with the record');
DATASET.Prior; //move to the previous record
end;
end;
```

## Description

Moves to the previous record in the dataset and makes this the active record. Also refer to [Dataset.RecordPosition](/flow/guide/scripting-reference/classes/data-set/dataset.recordposition) for moving to a specific record.
