Comment on page
Calendar data sources
A calendar data source can be used to generate a calendar or to group data in other data sources, such as all the transactions in a month. This type of data source contains objects based on time periods between two dates. For example, 12 objects for all of the months in a year or 168 objects for all of the hours in a week.
To add a calendar data source to an app:
- Open the app and navigate to Data.
- In the App Data panel, click the down arrow icon.
- Select Add Calendar Data Source.
To configure the data source you must specify a From datetime value, a To datetime value, and select a Resolution. The from and to dates specify the boundaries of the calendar. The resolution is the time periods that the data source will be broken into and each time period will be represented by an object.
You have a data source
Transactionswith a property
Transaction Date. You want to create a view where you can navigate between years and see all transactions for that year.
Then, add a calendar data source called
Monthly Calendarand set the following properties:
Active year, with a Value processor operation
Go to end of year.
When the app is loaded the calendar data source will generate 12 objects, one for each month of the active year. In your UI, you can use iterating containers to loop through each
Monthly Calendar. Inside that iteration, you can use another set of iterating containers to loop through
Transactionswith a filter expression
Transaction Date >= Monthly Calendar.DateTime Value AND Transaction Date <= Monthly Calendar.Period End. This will filter the data to all transactions in the given month and you can display them.
To navigate between years, you would need to add a UI element that triggers an update to the
Active yearvariable. The calendar data source will refresh automatically. Note that you should also have in a filter on the
Transactionsdata source to only read in transactions for the active year.
You want to create a visual interface for scheduling appointments in one hour blocks for the current week.
Add a calendar data source and set the following properties:
When the app is loaded the calendar data source will generate 168 objects, one for each hour of the week. In your UI, you can use iterating containers to visualise the weekly calendar and show an appointment for a given block.