# Error compiling event script for event id 'valueChanged'. SyntaxError: ("mismatched input 'prevStatus' expecting INDENT"

**URL:** <https://forum.inductiveautomation.com/t/error-compiling-event-script-for-event-id-valuechanged-syntaxerror-mismatched-input-prevstatus-expecting-indent/43745>\
**Category:** Ignition\
**Tags:** ignition79\
**Created:** [February 23, 2021, 7:11pm UTC](https://forum.inductiveautomation.com/t/error-compiling-event-script-for-event-id-valuechanged-syntaxerror-mismatched-input-prevstatus-expecting-indent/43745 "2021-02-23T19:11:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rigoberto.reyes](https://avatars.discourse-cdn.com/v4/letter/r/65b543/32.png) [@rigoberto.reyes](https://forum.inductiveautomation.com/u/rigoberto.reyes)\
**Post date:** [February 23, 2021, 7:11pm UTC](https://forum.inductiveautomation.com/t/error-compiling-event-script-for-event-id-valuechanged-syntaxerror-mismatched-input-prevstatus-expecting-indent/43745/1 "2021-02-23T19:11:32Z")

</div>

Hello.

I´m getting an issue running next script into Tag events/value changed

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/a/7/a7ad4038c19f047bed1bc13b7070c1ea06b746a8.png)

The script shows this error message:

Error compiling event script for event id ‘valueChanged’.  
SyntaxError: (“mismatched input ‘prevStatus’ expecting INDENT”, (‘tagevent:valueChanged’, 19, 0, ‘prevStatus = previousValue.value\t\t\n’))

Can somebody help me to understand the error and how to fix it?

Regards.

---

<div class="post-metadata">

**Author:** ![bschroeder](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bschroeder/32/13260_2.png) [@bschroeder](https://forum.inductiveautomation.com/u/bschroeder)\
**Post date:** [February 23, 2021, 7:49pm UTC](https://forum.inductiveautomation.com/t/error-compiling-event-script-for-event-id-valuechanged-syntaxerror-mismatched-input-prevstatus-expecting-indent/43745/2 "2021-02-23T19:49:29Z")

</div>

Python is white space dependent.

So your entire script needs to be tabbed in one tab stop under the valueChanged method.

If you want direct help you will need to post the code seperated by 3 of ` at the beginning and then at the end.

---

<div class="post-metadata">

**Author:** ![rigoberto.reyes](https://avatars.discourse-cdn.com/v4/letter/r/65b543/32.png) [@rigoberto.reyes](https://forum.inductiveautomation.com/u/rigoberto.reyes)\
**Post date:** [February 24, 2021, 3:18pm UTC](https://forum.inductiveautomation.com/t/error-compiling-event-script-for-event-id-valuechanged-syntaxerror-mismatched-input-prevstatus-expecting-indent/43745/3 "2021-02-24T15:18:35Z")

</div>

Thanks bschroeder, you are right and now the script is working… 😀
