Configuring polled events to trigger flows
App Connect has some pre-configured events that you can select as triggers for your flows. For some applications, you can configure more events that can trigger a flow by polling an application for new or updated objects. This tutorial shows you how to configure those polled events.
How it works
To create a polled event that triggers a flow, you configure App Connect so that it knows when something changes in your application. The application must add a timestamp when an object is created, and another timestamp each time that object is updated. This behavior is common for most applications. App Connect polls the application at regular intervals that you specify. If an update has a timestamp after the time when your flow was started, the flow is triggered and the actions in your flow are completed. To poll the application, App Connect needs the application to filter by timestamp so that it retrieves all objects since a particular time.
You can see which applications have configurable polled events on the Applications and APIs page of App Connect. When you expand a connected application, if you can configure events for it, you see Show more configurable events under the list of pre-configured events. Click the link and expand an object to see which events you can configure.
Configuring a polled event
- Click , expand an appropriate source application (for example, Salesforce), then click Configure more events.
- Expand the object that you want to monitor and select the type of event.
For example, to trigger your flow every time a new order is created in Salesforce, choose the New orders event.
- If prompted, provide any necessary information about the object that triggers your flow.
- Configure the fields to detect the event by polling:
- In the Created timestamp field, select the field from your application
that contains the timestamp for when the object was created.
The list of fields that are shown for both timestamps are the ones that are provided by the application for use in filters.
- In the Last updated timestamp field, select the field from your application that contains the timestamp for when the object was updated.
- In Format of the timestamps, enter a format for the timestamp by using
letters. Usually, the field already contains the correct formatting for the timestamp of the
selected application.
For some applications, timestamps might not be in a standard format that App Connect can recognize. Therefore, convert the actual timestamp that' the application produces to a letter-based format that App Connect can interpret. For example, for a timestamp of
2017-10-04T10:58:33+05:30, set the field toYYYY-MM-DDTHH:mm::ssZ. - In Timezone, select the time zone that applies to the timestamps. The
default time zone is UTC (Coordinated Universal Time).
App Connect needs to know what time zone the timestamps relate to so that it can detect updates that happen after the flow is started. For many systems, timestamps are returned in Coordinated Universal Time (UTC), which is the default time zone for App Connect. Some applications have a system-wide setting that causes all timestamps to be returned in a particular time zone. In other applications, the time zone is configured on a per-user basis.
- In Check for event every (minutes), select the
frequency at which App Connect polls the application for changes to
the object.
App Connect checks the application at the specified interval. If App Connect detects an update with a timestamp that's after the time when the flow started, it triggers the flow to complete its actions. If you specify a short interval, App Connect detects events more quickly, but uses more API calls.
- Select Is created timestamp queryable for new object events if the created timestamp field can be queried.
The valid selections for Created timestamp field, Last updated timestamp field, and Is created timestamp queryable by event type are as follows.
Event type Valid selections New object
Either of the following selections is supported.
- Select a value from Created timestamp field and select Is
created timestamp queryable. (Skip Last updated timestamp
field.)
With this selection, you use only the created timestamp to poll for new objects that were created within the specified time window.
- Select a value from both the Created timestamp field and Last
updated timestamp field, and make sure that the Is created timestamp
queryable checkbox is cleared.
With this selection, you use both the created and last updated timestamps to poll for new objects that were created within the specified time window. Events are identified as
new
only if the created and last updated timestamps match.
Updated object
Select a value from both the Created timestamp field and Last updated timestamp field.
(Is created timestamp queryable isn't displayed.)
With this selection, you use both the created and last updated timestamps to poll for objects that were updated within the specified time window. Events are identified as
updated
if the created and last updated timestamps are different.New or updated object
Select a value from Last updated timestamp field and skip the Created timestamp field.
(Is created timestamp queryable isn't displayed.)
With this selection, you use the last updated timestamp to poll for objects that were either created or updated within the specified time window.
Figure 1. Configuration of the Salesforce New order event
- In the Created timestamp field, select the field from your application
that contains the timestamp for when the object was created.
- Complete your flow in the usual way by adding whatever actions and logic that you need.
- Test your flow by creating or updating the configured object in your application and making sure that any actions are completed.