---
title: personFieldChanges()
slug: personfieldchanges
createdAt: 2021-09-14T16:33:14.000Z
---

Return a sequence of changes for the current person, for the given field.

### Syntax

Single field: `personFieldChanges(fieldCode, fromDate, untilDate)`

Multiple fields: `personFieldChanges(['fieldCode1', 'fieldCode2'], fromDate, untilDate)`



### Parameters

| **Parameter** | **Type**                                          | **Description**                                            |
| ------------- | ------------------------------------------------- | ---------------------------------------------------------- |
| `field`       | [String](https://docs.charthop.com/string)        | The slug or ID of a field or an array of multiple fields.  |
| `from`        | [Timestamp](https://docs.charthop.com/timestamp)  | Starting point of the date range to traverse (inclusive)   |
| `until`       | [Timestamp](https://docs.charthop.com/timestamp)  | Ending point of the date range to traverse (exclusive)     |

### Return

[Sequence](https://docs.charthop.com/sequence) \<[Job Changes](https://docs.charthop.com/job-changes)>&#x20;

| **Parameter**      | **Type**                                         | **Description**                                       |
| ------------------ | ------------------------------------------------ | ----------------------------------------------------- |
| `change.fieldCode` | [String](https://docs.charthop.com/string)<br /> | The value of the field that was updated by the change |
| `change.date`      | [Date](https://docs.charthop.com/date)           | Returns the data the that the change occured.         |
| `change.type`      | [String](https://docs.charthop.com/string)       | Will return one of `CREATE` `UPDATE` or `DELETE`      |



### Examples

`personFieldChanges(address, '-5y').count()`

Returns how many times the `address` field has changed in the last 5 years for a specific person.&#x20;

Would return `3` if the person had 3 changes to their `address` field in the time period.&#x20;



`personFieldChanges(address, '2024-01-01', '2025-01-01')`

Returns a sequence of changes to the `address` field between 1/1/2024 and 1/1/2025 for a specific person.&#x20;



`personFieldChanges(address).first.update.title`

Returns the original value of the `address` field that was set for a specific person.&#x20;



`personFieldChanges([NDA,PIAA,EmploymentContract], '2020-01-01', '2025-01-01')`

Returns a sequence of all changes to the `NDA, PIAA, EmploymentContract` fields for a specific person.&#x20;



`personFieldChanges(address.state).map{it.update.address.state}`

Example return:  `["TX", "CO"]`

Returns an array of all of the titles across all changes for a specific person.



`personFieldChanges(address.state).map{date}`

Example Return: `[2020-01-01, 2023-01-02]`

Returns an array of all of the dates of that the changes occured on for a specific person.



### CQLT Example Template

This would return a table with the dates and states that the person lived in.&#x20;

:::CodeblockTabs
Function

```javascript
  {% for change in jobFieldChanges('address.state') %}
  <tr>
  <td>{{change.date}}</td>
  <td>{{change.address.state}}</td>
  </tr>
  {% endfor %}
```
:::

