<p>I don't think there's currently anything in Craft that's going to help you here.</p>

<p>Ideally we'd track for dirty/changed fields in JavaScript on an edit entry page and pass that as a parameter into the <code>onBeforeSaveEntry</code> event.</p>

CC BY-SA 3.0
2014-10-31T23:38:39.903Z
Ok, I'll just have to write my own isDirty(). :)
André Elvan
CC BY-SA 3.0
2014-10-31T23:41:47.093Z
Cool... I think your hash idea is the way I'd try first. :)
Brad Bell
CC BY-SA 3.0
2014-10-31T20:21:01.187Z
2014-10-31T20:21:01.187Z
Brad Bell
<p>Is there a simple way to know if an entry's content changed when it was saved? </p>

<p>I'm pulling data from an XML feed and create/update entries in a section. I need to know which entries has new data. I guess I could check each field value individually, or make some kind of hash and check that. But is there some built-in way in Yii/Craft that is easier?</p>

<plugin-development><entries>
Check if content in entry has changed
# Check if content in entry has changed

(Asked by: username_0 on 2014-10-31)

Is there a simple way to know if an entry's content changed when it was saved?

I'm pulling data from an XML feed and create/update entries in a section. I need to know which entries has new data. I guess I could check each field value individually, or make some kind of hash and check that. But is there some built-in way in Yii/Craft that is easier?

**Tags:** plugin-development, entries


---

## 1 answers

### Answer by username_1 on 2014-10-31. Score: 1 | Accepted answer

I don't think there's currently anything in Craft that's going to help you here.

Ideally we'd track for dirty/changed fields in JavaScript on an edit entry page and pass that as a parameter into the `onBeforeSaveEntry` event.

> **Comments:**
> **username_0**: Ok, I'll just have to write my own isDirty(). :)  
> **username_1**: Cool... I think your hash idea is the way I'd try first. :)  

---

