# Import/View Calendar from Outlook or Gmail in Ignition

**URL:** <https://forum.inductiveautomation.com/t/import-view-calendar-from-outlook-or-gmail-in-ignition/59184>\
**Category:** Ignition\
**Created:** [May 3, 2022, 9:55pm UTC](https://forum.inductiveautomation.com/t/import-view-calendar-from-outlook-or-gmail-in-ignition/59184 "2022-05-03T21:55:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![prashants](https://avatars.discourse-cdn.com/v4/letter/p/a87d85/32.png) [@prashants](https://forum.inductiveautomation.com/u/prashants)\
**Post date:** [May 3, 2022, 9:55pm UTC](https://forum.inductiveautomation.com/t/import-view-calendar-from-outlook-or-gmail-in-ignition/59184/1 "2022-05-03T21:55:46Z")

</div>

Hi, I was trying to see if we can use ignition to view Outlook or Gmail calendar using Month View (Component Palette).  
Please let me know if you have used/created something like that before?

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [May 3, 2022, 10:52pm UTC](https://forum.inductiveautomation.com/t/import-view-calendar-from-outlook-or-gmail-in-ignition/59184/2 "2022-05-03T22:52:12Z")

</div>

There isn't much on the forum about this, one post i found talked about Google API

> [@Google Calendar API](https://forum.inductiveautomation.com/t/google-calendar-api/43458):
>
> Hello, I am using Ignition maker edition to automate my house, using a Raspberry Pi as a server. I have a display on a 7" touchscreen with tabs to: lights, temperatures, dashboard, etc. I would like to eventually add google features such as: Calendar, Gmail, Drive, but don’t really know how to implement APIs into Ignition. I have read the documentation on this (see below), but it doesn’t really make sense to me on where to start. Has anyone done this before, or have a step by step on how to imp…

I spent a couple minutes fooling around with exporting an outlook calendar, and you can export it in csv format, then read the contents of the csv. From there it would just be modifying the csv dataset to match the format of the moth view calendar events dataset.

This is as far as i took it, since im not sure this is even the direction you are interested in.

```auto
import csv
path = "C:\calcsv.CSV"
csvData = csv.reader(open(path))
header = csvData.next()
dataset = system.dataset.toDataSet(header, list(csvData))

```

---

<div class="post-metadata">

**Author:** ![josborn](https://avatars.discourse-cdn.com/v4/letter/j/4bbf92/32.png) [@josborn](https://forum.inductiveautomation.com/u/josborn)\
**Post date:** [May 4, 2022, 1:58am UTC](https://forum.inductiveautomation.com/t/import-view-calendar-from-outlook-or-gmail-in-ignition/59184/3 "2022-05-04T01:58:57Z")

</div>

Oof, i feel like this is poorly done, but it works.

```auto
import csv
from java.util import Date
from java.lang import String
from datetime import datetime
from com.inductiveautomation.ignition.common.util import DatasetBuilder

path = "C:\calcsv1.CSV"
csvData = csv.reader(open(path))
csvList = list(csvData)
header = ['startDate', 'endDate', 'displayColor', 'display']
newDS = DatasetBuilder.newBuilder().colNames(header).colTypes(Date, Date, String, String).build()

for x in range(len(csvList)):
	row = []
	if x > 0:
		row.append(csvList[x][1] + " " + datetime.strftime(datetime.strptime(csvList[x][2], "%I:%M:%S %p"), "%H:%M:%S"))
		row.append(csvList[x][3] + " " + datetime.strftime(datetime.strptime(csvList[x][4], "%I:%M:%S %p"), "%H:%M:%S"))
		row.append('blue')
		row.append(csvList[x][0])
		newDS = system.dataset.addRow(newDS,row )
event.source.parent.getComponent('Month View').events = newDS

```

This will import an outlook calendar if exported to CSV. ~~One caveat is you need to format the date columns in the csv to a 24 hour format. I am sure you could do it in the script though.~~
