// This module is included in the following assemblies:
// as_connecting-to-google-calendar.adoc

[id='add-google-calendar-connection-start_{context}']
= Triggering an integration when polling returns an event from a Google Calendar

To trigger execution of an integration upon obtaining events from 
a Google Calendar that you specify, add a Google Calendar connection to a 
simple integration as 
its start connection. When the integration is running, the Google Calendar
connection checks the Google Calendar for events at intervals that you
control. When the connection finds events that comply with the way that
you configured the Google Calendar *Get Events* action, the connection
passes the events to the next step in the integration. 

When a Google Calendar connection returns more than one event, 
{prodname} executes the integration for each returned event. 
For example, if the poll returns 5 events then {prodname} executes
the integration five times.

.Prerequisites
* You created a Google Calendar connection. 

.Procedure

. In the {prodname} panel on the left, click *Integrations*.
. Click *Create Integration*.
. On the *Choose a connection* page, click the Google Calendar 
connection that you want to use to start the integration. 
. On the *Choose an action* page, select the *Get Events* action. 
. To configure the *Get Events* action:
.. In the *Delay* field, accept the default of 30 seconds or 
specify how often you want the integration to check the calendar. 
.. In the *Calendar name* field, enter the name of a calendar that is
accessible from the Google account that this Google Calendar connection
is authorized to access. 
.. In the *Max Results* field, accept the default of *5* or 
indicate the maximum number of events that the connection 
can return for each poll. 
.. Select one of the following to indicate the date that you want the connection
to use to start checking for events. The connection checks that date and
subsequent dates.
+
* *Consume from the current date ahead* starts on the current date.
+
For example, if you select this option, and if *Max Results* is 5, then the Google
Calendar connection starts checking for events on the current date and
returns no more than the first five events that it finds. It does not 
matter whether or not these events have been updated or added since the
last poll.
+
* *Consume from the last event update date on the next poll* starts on the
date of the most recently updated event that was returned in a previous poll. 
+
For example, if you select this option, and if *Max Results* is 5, then the
Google Calendar connection returns no more that 5 updated or new events. The 
connection starts checking for new or updated events on the date of the
most recently updated event that was returned in a previous poll. 

.. Optionally, in the *Query for events* field, specify text to filter the 
events that the poll can return. The connection returns only 
events that contain the specified text in at least one event field. 
+
For example,
suppose that you specify `Standup meeting` in the query field. A poll would
return only those events that have `Standup meeting` in an event
field. 
. Click *Next* to add this Google Calendar connection as the integration's 
start connection. 

.Result
The connection appears as the first step in the simple integration. 
