# Alarm Journal Query not returning Label

**URL:** <https://forum.inductiveautomation.com/t/alarm-journal-query-not-returning-label/63574>\
**Category:** Ignition\
**Tags:** ignition81, perspective\
**Created:** [August 29, 2022, 6:43pm UTC](https://forum.inductiveautomation.com/t/alarm-journal-query-not-returning-label/63574 "2022-08-29T18:43:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![imt.sebastian.sanche](https://avatars.discourse-cdn.com/v4/letter/i/ecb155/32.png) [@imt.sebastian.sanche](https://forum.inductiveautomation.com/u/imt.sebastian.sanche)\
**Post date:** [August 29, 2022, 6:43pm UTC](https://forum.inductiveautomation.com/t/alarm-journal-query-not-returning-label/63574/1 "2022-08-29T18:43:13Z")

</div>

Hello, I’m trying to export a .CSV from the Alarm Journal. My main issue is that it is not showing the label, I thought that when you added the includeData=True it would include it didn’t so now I’m lost.

```auto
	start = self.getSibling("DateTimeInput_0").props.value
	end = self.getSibling("DateTimeInput").props.value
	
	journal = system.alarm.queryJournal(journalName="GA_Journal", startDate=start, endDate=end, includeData=True).getDataset()
	speadsheet = system.dataset.toCSV(journal, 1, 1)
	system.perspective.download('AlarmJournal.csv', speadsheet)

```

---

<div class="post-metadata">

**Author:** ![Gurjot\_Sandhu](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/gurjot_sandhu/32/38368_2.png) [@Gurjot\_Sandhu](https://forum.inductiveautomation.com/u/Gurjot_Sandhu)\
**Post date:** [September 6, 2022, 9:50pm UTC](https://forum.inductiveautomation.com/t/alarm-journal-query-not-returning-label/63574/2 "2022-09-06T21:50:35Z")

</div>

Hello imt.sebastian.sanche,

The includeData parameter in fact does not include the label, it instead has the event data details when you set that parameter to true. To get the label, you will have to reference each PyAlarmEvent returned in the [AlarmQueryResult](https://docs.inductiveautomation.com/display/DOC81/Scripting+Object+Reference#ScriptingObjectReference-Alarming) and use the getLabel() method. Using that method, you can iterate through the results and copy each label to a new dataset with the returned results, and then export that final copied dataset as a .CSV. Here is an example script of iterating through the result to get the label.

```auto
end = system.date.now()
start = system.date.addHours(end, -1)

journal = system.alarm.queryJournal(journalName="Alarms", startDate=start, endDate=end, includeData=True)
print journal.getDataset()
#print journal

for j in journal:
    print j.getLabel()

```
