# "mismatched input '' expecting DEDENT" issue

**URL:** <https://forum.inductiveautomation.com/t/mismatched-input-expecting-dedent-issue/66286>\
**Category:** Ignition\
**Tags:** ignition79, scripting\
**Created:** [November 9, 2022, 12:05pm UTC](https://forum.inductiveautomation.com/t/mismatched-input-expecting-dedent-issue/66286 "2022-11-09T12:05:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rodney\_Oliveira](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rodney_oliveira/32/40604_2.png) [@Rodney\_Oliveira](https://forum.inductiveautomation.com/u/Rodney_Oliveira)\
**Post date:** [November 9, 2022, 12:05pm UTC](https://forum.inductiveautomation.com/t/mismatched-input-expecting-dedent-issue/66286/1 "2022-11-09T12:05:14Z")

</div>

When I try to do this:

```auto
if event.propertyName == "acao":
	data = system.dataset.toPyDataSet(event.source.dsGeral)
	headers = ['acao', 'txt', 'script']
	newData = []
	for row in data:
		newRow = []
		if event.newValue == row[0]:
			if row[1] in (0,1):
			    newRow = [row['acao'], row['txt'], row['script']]
			    newData.append(newRow)
				event.source.subpasso = row[1]
				
	event.source.templateParams = system.dataset.toDataSet(headers, newData)

```

I get this error:

> Parse error for event handler "propertyChange" SyntaxError: ("mismatched input '' expecting DEDENT", (' ', 12, 4, '\t\t\t\tevent.source.subpasso = subpasso\n'))

but I can do this without any issue.

```auto
if event.propertyName == "acao":
	data = system.dataset.toPyDataSet(event.source.dsGeral)
	headers = ['acao', 'txt', 'script']
	newData = []
	subpasso = 0
	for row in data:
		newRow = []
		if event.newValue == row[0]:
			if row[1] in (0,1):
			    subpasso = row[1]
			    newRow = [row['acao'], row['txt'], row['script']]
			    newData.append(newRow)
			event.source.subpasso = subpasso
				
	event.source.templateParams = system.dataset.toDataSet(headers, newData)

```

Anyone knows why this happens?

---

<div class="post-metadata">

**Author:** ![pascal.fragnoud](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pascal.fragnoud/32/24728_2.png) [@pascal.fragnoud](https://forum.inductiveautomation.com/u/pascal.fragnoud)\
**Post date:** [November 9, 2022, 12:29pm UTC](https://forum.inductiveautomation.com/t/mismatched-input-expecting-dedent-issue/66286/2 "2022-11-09T12:29:52Z")

</div>

You're using spaces for indentation on the previous line.  
Don't mix up spaces and tabs for indentation, or you'll end up with this kind of error.

---

<div class="post-metadata">

**Author:** ![Rodney\_Oliveira](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/rodney_oliveira/32/40604_2.png) [@Rodney\_Oliveira](https://forum.inductiveautomation.com/u/Rodney_Oliveira)\
**Post date:** [November 9, 2022, 12:38pm UTC](https://forum.inductiveautomation.com/t/mismatched-input-expecting-dedent-issue/66286/3 "2022-11-09T12:38:44Z")

</div>

I don't know why that happened but that was the problem, thank you!
