# Alarm Journal CSV export

**URL:** <https://forum.inductiveautomation.com/t/alarm-journal-csv-export/58100>\
**Category:** Ignition\
**Tags:** ignition81, vision, scripting\
**Created:** [April 6, 2022, 11:46am UTC](https://forum.inductiveautomation.com/t/alarm-journal-csv-export/58100 "2022-04-06T11:46:02Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Darenn\_Yfrelle\_Villa](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@Darenn\_Yfrelle\_Villa](https://forum.inductiveautomation.com/u/Darenn_Yfrelle_Villa)\
**Post date:** [April 6, 2022, 11:46am UTC](https://forum.inductiveautomation.com/t/alarm-journal-csv-export/58100/1 "2022-04-06T11:46:03Z")

</div>

Hi to All,

I want to export a csv file through a component of BUTTON from the Alarm Journal, I did it using this script:  
**dataset = event.source.parent.getComponent(‘Alarm Journal’).getAlarms()**  
**file = system.date.now() \*\*  
 path = system.dataset.exportCSV(“data.csv”, 1, dataset)  
 if path != None:  
\*\* system.net.openURL(“file://”+path)**

…unfortunately, I’m not satisfied because the result (csv file) is lack of information, the event time is incomplete, I want to include the Date and there are missing columns when it exported. How can I solve this one?

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/1/b/1b29f8dfa4330c4630a85460c6fccb344cc797ea.png)

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/6/e/6e8c68a5a923ca61eb141db1a216349bf5af2e37.png)

Any ideas?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 6, 2022, 4:06pm UTC](https://forum.inductiveautomation.com/t/alarm-journal-csv-export/58100/2 "2022-04-06T16:06:16Z")

</div>

The right way to do it would be to issue your own `system.alarm.queryJournal` call to match the filters on the component, which gives you access to the same underlying data.

The more efficient, but not directly supported way, would be to get a reference to the underlying table component inside the AJT component, then extract it’s model, which will have a `getAlarmAt(row)` field (and `getRowCount()` method), which would give you full access to the reconstructed alarm event and allow you to pull whatever data you want into your constructed CSV.

---

<div class="post-metadata">

**Author:** ![Darenn\_Yfrelle\_Villa](https://avatars.discourse-cdn.com/v4/letter/d/c68b51/32.png) [@Darenn\_Yfrelle\_Villa](https://forum.inductiveautomation.com/u/Darenn_Yfrelle_Villa)\
**Post date:** [April 7, 2022, 2:31am UTC](https://forum.inductiveautomation.com/t/alarm-journal-csv-export/58100/3 "2022-04-07T02:31:35Z")

</div>

hi, i need to show the millisec in my exported csv file but only seconds is visible even though my alarm journal’s date format is yyyy-MM-dd HH:mm:ss.SSSZ

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/5/8/58c4f7fe034a0af20990139da8a704bceb3dd4bd.png)

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [April 7, 2022, 2:44pm UTC](https://forum.inductiveautomation.com/t/alarm-journal-csv-export/58100/4 "2022-04-07T14:44:00Z")

</div>

What does the data look like in a plain text editor/what does it look like if you change the date representation in Excel?
