web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Populating Calendar wi...
Power Apps
Unanswered

Populating Calendar with SQL table data

(0) ShareShare
ReportReport
Posted on by 79

I am trying to create a simple app that displays a calendar.  I have inserted the calendar frame onto my page and it is automatically pulling a couple different calendars, including my outlook calendar.   Can someone point me in the right direction to create a new calendar based off of data from an SQL table.  For example I have an SQL database with a table like this:

 

Start Time   

End Time
Duration
Description

Name of Tech

 

 

I would like to be able to populate a calendar with this information and then filter on the "Name of Tech" field.  Thanks.

 

 

Categories:
I have the same question (0)
  • GarethPrisk Profile Picture
    2,828 on at

    What 'calendar frame'? are you referring to?

    How is your Outlook Calendar connected to it? Just passing the Calendar data, or a reference to it?

    Since we are visualizing a calendar - need to understand what is being used to display it, to understand how to transform your data into that format.

  • nhale Profile Picture
    79 on at

    Insert \ New Screen \ Calendar   is the "frame"  I was referring to.   I am just trying to figure out a way to either use this control against data from a table (as in my example if possible) or if there was a way to create a calendar from my table data and point to that.   I'm not certain how I got this control/page connected to my outlook calendar it was just there.   Thanks for your help.

     

  • GarethPrisk Profile Picture
    2,828 on at

    Gotcha!

    That is a template screen which MSFT provides. By default, it is now adding a Data Source (Office365Outlook) to your app, and then performing relatively complicated functions to organize and present the data to do.

    For example, the OnSelect of the Calendar Drop Down is this function

    /*retrieves calendar events for all days in current month view and selected calendar 
    _minDate and _maxDate act as markers to prevent duplicate data collection*/ 
    If(IsBlank(_userDomain), 
    	UpdateContext({_showLoading: true}); 
    	Set(_userDomain, Right(User().Email, Len(User().Email) - Find("@", User().Email))); 
    	Set(_dateSelected, Today()); 
    	Set(_firstDayOfMonth, DateAdd(Today(), 1 - Day(Today()), Days)); 
    	Set(_firstDayInView, DateAdd(_firstDayOfMonth, -(Weekday(_firstDayOfMonth) - 2 + 1), Days)); 
    	Set(_lastDayOfMonth, DateAdd(DateAdd(_firstDayOfMonth, 1, Months), -1, Days)) 
    ); 
    Set(_calendarVisible, false); 
    UpdateContext({_showLoading: true}); 
    Set(_myCalendar, dropdownCalendarSelection1.Selected); 
    Set(_minDate, DateAdd(_firstDayOfMonth, -(Weekday(_firstDayOfMonth) - 2 + 1), Days)); 
    Set(_maxDate, DateAdd(DateAdd(_firstDayOfMonth, -(Weekday(_firstDayOfMonth) - 2 + 1), Days), 40, Days)); 
    ClearCollect(MyCalendarEvents, Office365Outlook.GetEventsCalendarViewV2(_myCalendar.Name, Text(_minDate, UTC), Text(_maxDate, UTC)).value); 
    UpdateContext({_showLoading: false}); 
    Set(_calendarVisible, true)

    You can definitely tweak this function to meet your needs.

    HOWEVER, you will need to also review all of the controls that are added to the screen and tweak them to meet your needs. This is not a simple undertaking; but gives you a great place to start.

    This guide will help you: https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/screen-templates/calendar-screen-overview

     

  • nhale Profile Picture
    79 on at

    Thanks for your help.  I have spent several hours now trying to get this to work only to discover that the reason I am not seeing any data is that Powerapps is not able to delegate the filter by date to the SQL server.  Soooo basically I can not filter by date on a table that is over 500 records (in my case I'm way over that) unless I add a computed integer date field into my SQL table.  Seems like maybe this is a bug that has been around since 2016 without a fix.  Lucky me I stumble onto this in my first evening with Powerapps.  I am beyond disappointed.   

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard