Connect multiple data sources
Show visits and work orders on one Avonni Calendar by combining several record collections into one event collection with a flow action.
A dispatcher plans visits stored as Event records and repairs stored as WorkOrder records, and wants both on the same board. The Avonni Calendar reads one event collection, so the flow merges the two with the SObject Collection to Scheduler Events action, then hands the result to the calendar.

Before you start
You have built the calendar of the Calendar 101, with a Variable data source and the technicians as resources.
You know how to create a resource and add an Action element in Flow Builder.
Steps
Merge the collections with the flow action
Add an Action element after the Get Records elements and search for SObject Collection to Scheduler Events.
In the first Collection box, pick the Event collection. Under Data Mappings, set Title to Subject, Resource Name to Assigned To ID, From to Start Date Time and To to End Date Time.
Click Add Collection and pick the Work Order collection. Set Title to Subject, Resource Name to Owner ID, From to Start Date and To to End Date.
To give each kind its own color, open Advanced Options in each box and set Color, for example
#0176d3for visits and#fe9339for work orders.Store the action's output in
allTeamEvents. In Flow Builder, this is under the action's advanced options, Manually assign variables.

The action takes up to ten collections. Resource Name must hold the same value as the resource Key Field (a User ID here), whatever the object.
Point the calendar at the combined collection
Open the calendar in the Component Builder. In the Data Source section, select Variable.
In Resources Collection, pick the User collection, and map Label as in the 101 tutorial.
In Events Collection, pick
allTeamEvents.
Data Mappings now lists only Resources: the title, resource, dates and color of each event were already set by the action.
Save and test
Save the flow and run it with Debug. Each technician's row shows both their visits and their work orders, each with its own title and times: visits in blue, work orders in orange. For colors that follow a field instead of the object, see Color-code calendar entries.
Related tutorials
Calendar 101: the Variable data source and the resource mappings this page builds on.
Use a Query data source: when one object is enough, skip the flow elements.
Troubleshoot resources and missing events: when work orders land on an Empty row.
The action's inputs are listed on SObject Collection to Scheduler Events.
Last updated
Was this helpful?
