I am trying to build a "request a car calendar" app using canvas and after some review I thought it was best to connect to a sharepoint calendar, that way I wouldn't need to store or pull any old data. Additionally I have seen some of the calendar apps suggested online on powerapps that does not offer calendars that show multiple events on each square (day). I am trying to gauge the community to see if I am going this the right way. So we will have multiple cars that can be booked at any given time. And the user would need to go in the app to first see if the car is available for that date, then book it if it is available, or change the date if necessary.
Since sharepoint has calendars, would it just be simpler for users to access the sharepoint calendar instead? However, it would require an admin to approve/deny. Unless there is some auto logic that can be built into a sharepoint calendar? In that sense, would it be a good idea to have the powerapp do the logic while connecting to sharepoint? Thank You.
Solved! Go to Solution.
Sorry to keep bugging you. I have been working on and off the past two weeks on this project and reviewing your code as reference and I just can't get the results that I am looking for. I appreciate the snippets of examples you provided me but I just don't see without your collection containing all the days of the month from sharepoint, how I would be able to display a full Calendar like the one below:
Please correct me if I am wrong, but your application would only show dates with delivered meals. My intention is to show the whole calendar, and display each event within that date. However I do find your example very valuable in helping me understand each function individually which can help me build the app as a whole.
In your code you showed me -- Gallery 2 Items: Filter('DelMeal Dates',DateDel=ThisItem.DateDel)
I did not know you can filter a column 'DelMeal Dates' vs the actual collection. And I am not sure where DateDel is from. Do you mind showing me a snippet of your tree view in the app such as the one below (with all controls expanded):
Thank You very much.
PowerApps has a calendar proforma screen setup like the one you've posted that you could work with to design what you need. To start click New Screen --> Calendar.
I've just been messing with this today but it seems that the main collection used throughout this screen is MyCalendarEvents which is created / updated in the OnSelect of the dropdown box (top RH corner). I commented out the ClearCollect(MyCalendarEvents ...) and added my own code of
ClearCollect(MyCalendarEvents, Sort('Leave Calendar','Start Time',Descending));
This code pulls through my SP calendar events instead of my Outlook calendar events, as designed by the original code.
It is then just a matter of messing with your new collection to build out what you need eg make the calendar full-page, add icons that meet your needs, etc
I must say, I'm having a few issues references columns I can see in the collection of events (View --> Collections --> MyCalendarEvents) but it would just be a case of persevering.
Please correct me if I am wrong, but your application would only show dates with delivered meals. - correct, only shows dates where there is data.
Here is the tree of the gallery inside the gallery:
Hope this helps.
Thanks for your screen shot. I did use the outlook calendar app that came with powerapps and I watched a video on youtube to convert that to a SP calendar. However it only shows the circle for an event. I'd have to click on the date to show the event on a seperate gallery. I can do the calendar this way, I thought I could show the SP events under each date. I'll see if I can find someway to make this happen with collections. Thanks again for all your help.
I make it show the details just using a simple LookUp text box and it seems to work fine if you don't want the side gallery. Just run out of room so I've limited the data that shows and put some of it on my ToolTip so they can see more details when they just hover over it.
Thanks for the tip. The lookup function worked for me. I used it on a label control.
Now what if I have more then one event for a specific date? The lookup only finds the first one with the reduction parameter option. I don't think filter or search has any reduction options, even though it can find multiple records.
No, not for a label anyhow. You could try a subGallery or maybe a list box for that though. I have tried it in this context but seems logical it could work.
I am making progress but I am stuck with filtering the subgallery item (Mainly because my main Gallery items is not a collection, rather hard coded dates). Referencing your code:
Gallery 1 Items: SortByColumns(colDelMealGroup,"DateDel",Descending)
Gallery 2 Items: Filter('DelMeal Dates',DateDel=ThisItem.DateDel)
In Gallery 2 Items, is DateDel referencing the DelMeal Dates Table, and ThisItem.DateDel referencing the column in colDelMealGroup?
colDelMealGroup is built using GroupBy which is why it may seem a little confusing, sorry.
I think I mentioned earlier I used GroupBy but didn't explain how I did it. Here's the code I use:
// collects latest Meals for LoggedIn Camp, Sorts by date Desc ClearCollect(colDeliveredMeals,Sort(Filter(DeliveredMeals,CampName=varLoggedInCamp),DateDel,Descending)); // Groups above collection by DateDel, column 'DelMeal Dates' holds the table of the grouped data for Gallery2 ClearCollect(colDelMealGroup,GroupBy(colDeliveredMeals,"DateDel","DelMeal Dates"))
- colDeliveredMeals is a collection made using the logged in Camp / Site
- GroupBy then takes this collection and groups it by DateDel. GroupBy, in this instance, is a collection with 2 columns ie DateDel and the new column "DelMeal Dates". The data type of the column "DelMeal Dates" is a table (see below):
Selecting a table inside "DelMeal Dates" yields all the data getting referenced which has the same table schema as a SP List, like this:
Hopefully this gives you all the parts you need? Let me know if I need to explain further.
No you did explain it clearly, I understood your code and logic, I just dont understand the Gallery 2 Item property:
I am confused because 'DelMeal Dates' does not have a DateDel column, then what is the DateDel in the Filter referencing? Then, what is ThisItem.DateDel referencing?
In other words I am interpreting the filter like so:
If DateDel in 'DelMeal Dates' is equal to colDealMealGroup's DateDel (ThisItem.DateDel), then have the rows in 'DelMeal Dates' that match this criteria be available as items for Gallery 2. I guess I am stuck because I dont see a DateDel in 'DelMeal Dates'. Or I am just interpreting this incorrectly. If you can break it down for me that would be helpful. Thanks.
Check out new user group experience and if you are a leader please create your group
We are excited to announce that Demo Extravaganza for 2021 has started!
On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks
Did you miss the call? Check out the recording here!