Cursor
This function card is only available in Connector Builder.
This function card only functions within a polling monitor event flow.
When the Cursor card executes, it saves a value to the flow metadata that can be used to filter API queries for scheduled executions of the polling monitor.
This value is specific to each flow that your users create with your deployed polling monitor.
Typically, the cursor stores a time stamp value for use as an API query filter. It can also store state values for the polling request, for example, a list of previously recorded identifiers.
A cursor has a 10 KB size limit. Using cursors to store large amounts of data may cause errors that require your users to reactivate their flow and reset the cursor.
The easiest implementation for a cursor in polling monitor events is to query the API using a time stamp. This method returns new or updated records, and doesn't require a complex cursor object to retain other metadata between polls.
Add a Cursor card
When you create a polling monitor event in Connector Builder, the event card includes an output named Cursor. Creating the polling monitor event also adds this Cursor function card that includes a single input named Properties and has no outputs.
Each time the polling monitor runs, the value passed into the Properties field becomes the new value of the Cursor field on the Polling Monitor event card.
The Cursor card supports the following types: Date & Time, Number, Text, and Object. You can use whatever format is required to construct the filter for your API call. The types specified on the Cursor field of the Polling Monitor card and the Properties input field of the Cursor function card must match.
Update the Polling Monitor card
The first time the polling monitor runs, the Cursor field on the Polling Monitor event card is empty, so your flow needs to handle that initial run. If the Cursor field is empty, skip over the card that invokes the API to fetch records. Initialize the cursor, for example, with a Now function card if you're using a time stamp for the cursor. All subsequent executions of the polling monitor have a Cursor field with value because the flow invokes the Cursor card each time.
Use the cursor for query filtering
For future runs, the Polling Monitor card's Cursor field includes the assigned value from the previous run. The flow takes this value as the starting point for the API query's filter, for example, as a parameter called startDate.
Create another data point as the ending point for the API query. For example, invoking the Now function card provides a new endDate parameter. You can then provide the startDate and the endDate parameters to the API query. The parameter names depend on the filter names specified by your API service. The time window is the duration between when the polling monitor last executed and the current execution of the polling monitor.
Use the startDate and endDate parameters as filters to your API request. After retrieving the records, the flow updates the Properties field on the Cursor card for use in the next scheduled execution.
For an example of a polling monitor event flow with the Cursor card, see Build a polling monitor event flow.
Input
Field | Definition | Type | Required |
---|---|---|---|
Properties |
A stored value to use in your polling monitor event query. The field can be any of the following types:
The selected type must match the Cursor output field on the Polling Monitor event card. This field has a size limit of 10 KB. See Cursor card in Connector Builder feature limits. |
Various |
TRUE |
Output
This card has no output fields.