---
title: "PRIOR"
url: "https://help.formsfly.com/en/article/prior"
language: "en"
last_updated: "2024-11-01T15:46:16.638Z"
---

# PRIOR

Gets the previous repeat/row value(s) of the named field within a Page/Table, starting from the current repeat context.

* * *

### Syntax

`PRIOR('dataname', occurrences)`

### Example

```plaintext
PRIOR('myfield') List of all prior answers

PRIOR('myfield', 1) last prior value only
```

Optional second parameter specifies how many prior answers to retrieve.

### Notes

Should only be used within a repeatable Page or Table.

Prior repeat values are returned as a List unless the second parameter is 1; if so the value of the last prior answer is returned. Useful for performing aggregate functions on repeat values thus far  (e.g. [SUM](https://help.formsfly.com/en/article/sum),[COUNT](https://help.formsfly.com/en/article/count)) and, if second parameter is 1, for copying forward the previous repeat/row value into the current new instance.
