For a given month and the other to plot the days of the week we will connect this calendar control to a data source like a sharepoint list show items on the calendar based on a.
Specific date or a given date range color code the items and a lot more so let's check it out in action a very common request is for a calendar.
Control in powerapps the calendar control here showcases the dates for the current month i am in which is june it also highlights the current day which.
Is june 10th i can move through the different months of the year by clicking on the next or the previous icon.
And this control is what i can connect to my data sources to create enhanced experiences the first example here is asset management.
June 15th and as of this date there is a device that is due from one of my users sarah the calendar has this dot symbol that will be highlighted for the specific.
Date only if there are devices due on that date so for example june 16th there are no devices due if i select this the gallery showcases that there is no.
Devices that are due on this date but if i pick a date that have devices that are due the gallery will list out all those devices i can also leverage the same calendar.
Control and showcase the data for the specific dates within the gallery itself let's take an example for travel requests.
Users record travel request information in my back end data source in this scenario it's a sharepoint list along with the dates for the given month i am also showcasing all the travel.
Posts Related:
Requests that were entered for those
Specific dates these requests are color coded based upon the status of the travel request.So client travel for reza has been approved if i select this it will showcase the details of that specific sharepoint list item in a pop-up dialogue experience.
Red indicates these requests were rejected yellow indicates that these requests are pending so i can see all the requests for the.
Specific month and as i move across the different months it will automatically filter the data to only show me the information for that.
Specific month additionally i can also filter the data in this calendar experience currently it is showcasing all the travel requests irrespective of the.
Status if i select a specific status let's say approved the calendar will filter the data to only show the items that are approved.
I can also filter this based upon the users who are creating these travel requests so show me all the travel requests that were created by sarah.
I recently did a video around the form control in powerapps wherein i showcase the scenario around a recruitment tracker process wherein i have the list of the.
Candidates who are applying for specific positions i can select the specific candidate look at the details of the applicant i can edit and make modifications on the.
Form control experience
Now this specific gallery view showcases the list of all my candidates and i can leverage the same calendar control experience that i have styled.Here with the background image to give it a more appealing look it is that same data coming from my sharepoint list the data is plotted on a calendar.
Control experience the data that is being showcased is based upon the interview date that has been specified for that specific candidate.
Rafael nadal's interview date is set as june 14th if i select this it will directly take me to that form control experience wherein i can make changes.
Maybe the interview date has changed maybe it's changed to the 23rd of june so i'll make the update hit submit the data has been updated i will go back.
To my calendar view and we can see how the calendar control has updated the information related to that specific item now the entire idea of this video is.
Around creating this calendar control and in powerapps there is no out of the box control that is provided for us for the calendar experience there is an input control that is of.
Type date picker that opens up a calendar like experience however i need the calendar control itself on a screen when i can take action on it when i can.
Superimpose my data upon it and more and to create a calendar control in powerapps we have to go about creating a gallery so we showcase all the days of the week we then need to write logic to.
Get the first day of the month what's the last day of the month we need to print the month to write logic to move from one month to another and so and so forth.
I will show you how you can create a calendar control experience literally within five seconds i will start with a blank power app i'll click create.
I will give my app a name i'll pick the tablet form factor for my app and i will click create in my powerapp studio experience for me to create a calendar control.
All i have to do is head over to new screen and there is a screen template provided for us which is called calendar i will select this.
This will add a new screen that has that exact calendar control experience that i showcased earlier once the screen is created click on preview.
Here on the top there is a drop down that lists out all the calendars from your office 365 outlook calendar in my case i have three and that's the.
Reason why it is listing out those three calendars so if i pick my main calendar this will list out all the events in my calendar for the month of june.
Any dates that have an event there will be this dot symbol that will show up below the date so if i pick the 9th of june i had a lot of meetings that i scheduled for focus time so i can see a.
List of all those meetings the 10th of june which is the current date is highlighted in a different background shade so if i pick this it shows me the data for the 10th of june.
Now this is an out of the box screen template so if you ever have a requirement wherein you need to show the users there are events for the day based on their calendar you can simply just go.
Ahead and use this template however in this template what caught my eye the most was this calendar control experience now it is important to know a little bit.
About how this calendar control is built in the first place so if you look at this main calendar control this is a gallery which is called a month day gallery.
And here in the items property it has an array that goes from 0 to 41 basically six weeks of data so it plots six rows of data in this gallery.
This calendar symbol that you see here when you click on this it sets some key properties that this calendar requires one is it sets the date selected to today's date.
Then it goes and gets the first day of the month by writing the following formula the first day in view that means in this list of 42 days that's being mapped out.
On the calendar what is the first day in the view june 1st is a wednesday if we look at the sunday that is may 29th and if i double click on first.
Day in view we can see that right here however if you look at the first day of the month that is june 1st and then it also has another value for the last day of the month which is june.
30th in this gallery the title label control if you look at its fill property it sets a different background color for the calendar item depending upon.
If the date selected is today and that is the selected date then it puts a specific color to it if the date here is today's date and it is not selected then it has this.
Specific color and if the date is outside the range of the current month then it goes ahead and puts this gray background color then there is a subcircle shape.