Template Tuesday: Time Off Power App
Vložit
- čas přidán 28. 08. 2024
- #PowerApps #PowerPlatform #Templates
In this Template Tuesday I highlight my Time Off Management Power App Template.
This solution allows you to enter requests for time off, see your request history, view your teams vacation schedule on a shared calendar, and approve requests all from one central application.
In this video you'll learn:
✅ How to incorporate SVG's in your Power Apps
✅ How to use a Calendar Component
✅ How to surface SharePoint list items in a Calendar Control
✅ Implementing Security Trimming in your Power Apps
✅ Formatting Date Values
✅ Getting the difference between two dates
You can download this solution from my Github: github.com/apr...
Really cool, I'm going to replicate some of these ideas, very inspiring
Thanks Matt!
Hello April,
I really enjoyed your app. I am currently making one myself. I have a question:
Have you thought about how to restrict a person from taking the same day off multiple times? I demo'd your app and it allows me to request and approve the same 8hr day.
Hi April, many thanks for this video!
I am having an error in the svg visual, it somehow doesn't draw the used Days correctly. I use the following code since the ":" were throwing an error:
& ThisItem.RequestedTimeOff / ThisItem.AllottedTimeOff * 100 & " " & (100 - ThisItem.RequestedTimeOff / ThisItem.AllottedTimeOff*100) & "'
Any idea why the svgs don't show the proportions correctly?
Thanks in advance
Could you please do a video on the SharePoint Lists for this video? The Time Off Types and Time Off Balances Lists are very confusing.
I am really grateful for this, it is very timely for me. Something simple that I know you can help with is that the "Clear" button on the CalendarScreen has a blank OnSelect property. I tried Reset(Calendar_1) and it doesn't do anything.. what should be in the OnSelect for the Clear Button. Thanks!
ff
You can try the Remove function. That might help you delete items you don't want saved on your SharePoint List.
why not have a power automate flow that does a bunch of stuff based on this app. I also want to ask what dataset does this use. does it use an excel sheet and is it updated after each request is approved?
Very nice video!!! Hey, April! Is there a way off adding a formula to give employees balances every month instead of all at once? For example, all my employees receives 1 PTO per month. Also, is there a way to also give more PTOs per month based on the tenure of the employee? For example, all employees with one year of work gets 1,2 PTOs per month, and a person with 5 years tenure is entitled of 2 PTOS per month
Thank you!..hopefully to learn more about power apps
You're welcome!
Great video. Can I ask where the approval notes get stored as I can't seem to find where they are stored? It would be useful if the user could click on their rejected request for example and see the notes given by the approver?
following
I love this!! I have a quick question for you. I am currently using a MS Teams shared calendar for my team and we have it color coded etc and I don’t want to loose this calendar or it’s personalization to our team, but I want to use your power app to generate the approvals process. Is this possible? Any direction would be so very greatly appreciated!!
Hi April, Thanks this is very helpful. But is there a way to populate the amount of time off available fields by individual? Our employees have different amounts of vacation available; would it be possible for the app to go to a list that has that information? Thanks.
I have the same question, were you able to find the answer?
I’m working on this too. I’d imagine you could create an edit gallery which has its item as the list which stores the information for each user and then you could just go in an edit them from the gallery. I also need to get a lot of users into the list so I’m going to try and create a flow which adds all of the users with a default allocation of days.
Great video ! I have a question. Does this app assume all employees have the same allotted time for the various time off type? Thanks for your help.
Hi Kat - Yes it does but that's something that is easy to adjust.
@@AprilDunnam - what should we do in order to set a different Allotted time for employees? Please share it to us.
Hi April, I am having an issue with this syntax: "ThisItem.'TimeOffType:Allotted Time'.Value". Power Apps doesn't seem to recognize the function " 'TimeOffType:Allotted Time.Value' ". Any suggestions?
This worked for me---> 1. add a space between the colon and Allotted 2. Remove the space between Allotted and Time. You will need to update this in every forumla that calls out this column . Even if you were to copy and paste column names directly from her tutorial like I did, powerapps modifies the format for some reason and it messes up the codes in the template
'TimeOffType: AllottedTime.Value'
@AprilDunnam First, I want to say THANK YOU! You are amazing and I am new at PowerApps/Power Automate and find your content VERY helpful. I am stuck and feel like my lists are not setup correctly. I followed the instructions in the git but I definitely dont have my columns correct. Is there any way to share a screenshot of your lists/columns so I can better understand? If not April, can anyone else share their lists - in particular the "Time Off Types" list. Once I see an example list, I am sure I can work it out. THANKS!!
Hi April, thank you so much for this, but I'm having trouble with the sharepoint Lists. I created all the list as instructed, but I am getting confused on some of the instructions. For instance. In the the Time Off Balances List you said to "Create a Lookup Column to the Time Off Types List called 'TimeOffType'. Include the Allotted Time in this lookup." What list is the lookup looking into? Any help would be much appreciated.
This is awesome, thanks.
Would it be possible to collect a list of multiple individual dates instead of a date range per request?
Hey - you could take the output that is provided by the control (a start date and an end date) and output it to a collection of individual dates by adding this code to a button somewhere on the screen:
ClearCollect(
DateRange,
AddColumns(
FirstN(
[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29],
DateDiff(StartDate, EndDate, Days) + 1),
"Day",
"Day " & (Value + 1),
"Date",
DateAdd(StartDate, Value, Days)
)
)
@@AprilDunnam Hi April, thank you for your help. What about changing the output of the calendar to separate single dates instead of a range. For example 3 separate dates. (03, 11, 15 Dec). Any ideas? Many thanks.
@April Dunnam thanks so much for this insightful video. I have the same question as Zuni, any ideas on how we could select multiple days instead of a range and output hours per each day?
Subscribed. Please, please make a full video tutorial 🙏🙏 I am a newbie, and many steps are confusing for me.
This is such a cool app. But newbies like me can't build it. We need a full video tutorial and also in a new video you can improve the app based on comments below. Some people suggested how the app can be improved.
How can I add the national holidays of employees from two share point list, one have employee name, email and countrycode and other have date, countrycode and eventname. Can you please share the code which I can put for the teams calendar
Thank you very much, I'm just beginner and you helped me a lot, and please advice, this function not working with me (ThisItem.'TimeOffType:Allotted Time'.Value) even without space .
Hi Amr - I would try deleting that and let the intellesense help you out. It's probably a mismatch in the field names. So delete the formula and type ThisItem. then see what values it gives you. Trying to find a field called time off type. Then do a dot after that and find a field similar to allotted time then a .value on that
@@AprilDunnam Yes that's I'm doing but the problem with that COLON ( : ) between the value is not recognize it at all. for info I'm using powerapps with default environment?!
@@4mryano Did you find the solution I'm having the same problem
@@kristofdeprest9117 . I just downloaded the app, which is great April! - I noticed this issue, what I did based on April above comment is to replaced the original instruction from ThisItem.'TimeOffType:Allotted Time'.Value to ThisItem.'Allotted Time Off' and it is working fine.
@@4mryano I have the same problem, did u find the solution?
Amazing 😍 Video, you just helped me in a work where I was stuck!!
One more thing could you please make a video on Attendance Application?
I am facing a little problem in my application? Could you help me solve ?
So glad to hear this helped you get unstuck! Sure I can add an Attendance App to my list of templates to work on.
@@AprilDunnam Thanks, but I am stuck a bit in my attendance application, could you please help me? with it?
Very informative template. Thank you for your work. Though I have one question, Is is possible to approve/reject the request from the form (viz already present) as well as starting a flow approval to get the lazy approval from the emails? How do we bind the approval response from flow with Approve button in the form.
This is mostly the use case if user by mistake deletes the approval request email from flow.
If you want to use Flow for the approval then I would just leave the approval button in the form as-is so if a user is in the app and wants to approve from there they can. Then just create an approval flow which kicks off when a new item is added and sends out the approval. In your Flow if you mark the status of the item to Approved or Rejected after the approval finishes then it will automatically fall off the app approval screen.
@@AprilDunnam Yup was thinking the same. Just thought if there is a way we can bind it together. Anyways thank you for your reply. really appreciate what you are doing!!!
I wish you had full build videos for us newbies
To clarify - are you wanting a video from start to finish on how to build out this entire time off app? Or how to install it?
@@AprilDunnam how to build it from start to finish 😊
This is great April, thankyou for sharing this. I have implemented it and customised it to suit our needs. However, a request has come through for the approved time off to be then written to the user's calendar in Office365/Outlook.
I'm thinking that the approval button will kick of a Power Automate flow that writes the dates into the requesting user's online calendar. What do you think, or do you have a better way?
Hey Paul - You could actually do that directly in the Power App. There's an Office 365 Outlook Connector that you could add. Then on the "Approve" button "OnSelect" you can call the Office365Outlook.V4CalendarPostItem action to add the calendar invite. I've actually been meaning to make a video on how to do this.
@@AprilDunnam Hi April, great work! Have you had a chance to work on the PostItem action?
@@AprilDunnam Hi April, following on from your suggestion, I can now write to the Outlook calendar. The problem is that it writes to the approver's calendar, where it should be writing to the requester's calendar. I tried adding the requester to the required invite which works but the approver told me that he doesn't want it writing to his calendar as well. I'm not having much luck finding the solution for this.
The other issue I am having is the date format. Even though everything is setup for European date formate (dd/mm/yyyy) it only works if I format the date as US (mm/dd/yyyy) which is pretty annoying and took me a while to figure out. Any suggestions?
One last thing, in some instances, for some weird reason the end date is written to the calendar a year in advance, so instead of getting a 3 day holiday, the requester gets a 1 year and 3 days holiday. Looking at the SharePoint list the date range is correct but the Outlook view shows the end date as 2021. Clues?
@@PaulShadwell Hi Paul, i have a problem in The Summary Screen-Text(LookUp('Time Off Balances',Employee.Email = curUserEmail && TimeOffType.Value = selectedType.Title).'TimeOffType:Allotted Time'.Value *1,"[$-en-US]#"), could you please help me?
Did you ever figure this out. I am having the same issue. It is the only error I have left to fix.@@isaacsalazar1694
Thank you for this very helpful template. I salute you!!!
Thanks for watching!
If a manager goes in to the approval board will they see all approvals from all employees in the company or just their direct reports?
The SVG is not working and also where I want to go from Team page to Calendar Screen
Hi April, awesome. Kindly provide me with details of Sharepoint Lists field names. I am a newbie to Microsoft 365
You can find that info here: github.com/aprildunnam/PowerApps/tree/master/Time%20Off%20Template
Hi April
I have pasted the svg code as you told in the video but the customized value that you inserted in the donut about the number of holidays taken up on the total number of holidays is not working for me
Great 👍👍👍
Thank you! Cheers!
Followed the instructions but it did not work. My lander page shows nothing. I have no clue on how to use power apps so I can’t determine what I did wrong :(
Is there a video where you show how you setup the approval screen?
This is really helpful. But what should we do in order to set a different Allotted time for employees? Please share it to us.
What I did to get around that was in the time off Types List, I made an extra column(A people column). I named it employee, I then put the employee name in the column and then created an entry for each employee and in the app I filter the time off by the employee column based on the user who is using the app.
this is a great app thank you for sharing it for us, I have a question I managed to exclude weekend and holidays, but the gallery days in the summery doesn't show them right can u advise me on this ?
Can you give me more detail on what you mean by doesn't show them right?
@@AprilDunnam sometimes the date range show me weekend or it doesn’t include the End date I’m not sure if the FirstN function is the problem
hey april, pasting in the svg code does not work for me, any advice?
Could be a couple things:
1. You have to make sure the SVG code is in quotes "
2. Because you have to make sure the SVG code itself is in quotes that means anywhere in the SVG code that there is already a quote " you need to replace that with a single quote '. I just open it in a text editor and use fine and replace
3. You have to append your svg code with "data:image/svg+xml," & EncodeUrl( ** paste in code here ** )
Do you have a full tutorial of how you made this app?
Hello! I have this app almost setup for my org! Has anyone been able to figure out how to reset or clear the calendar to go back to the default start date? Thanks for any help given!
Could you set up the share point lists?
april are you able to share some screen shots of what your time off type sharepoint list looks like as well as the time off balances. i feel like ive tried everything but it is still not displaying anything on the page.
Did you figure it out?
Thank you excellent
You're very welcome. Thanks Sundra!
Hey April this Great I been having some issues with SharePoint as the Data source I know I’m close but can’t figure out what I’m doing wrong. Is there any assistance I could get or some tutorial on setting up the list?
Could you set up the share point lists?
Great video!! Thanks, April.. I was not able to import the zip file from your GitHub though.
Why weren't you able to import - did you get an error? How did you try importing it?
@@AprilDunnam I use the "Import canvas app" option. Then Import package> Upload > selected ConfetenceApp_1_5.zip. I see uploading your package...don't navigate away...then a red bar at the top saying "Something went wrong. Please try again " error
I salso go that with the timeoff template.
any news on that? importing the template is still not working :(
Hello, This is cool, i have been able to replicate this by downloading the file from your git. However how do I exempt weekends from the calendar selection in range?
Hi Utoro - this is a little tricky to do. This post on the power users community should help you out: powerusers.microsoft.com/t5/Building-Power-Apps/Leave-Request-Exclude-weekends-and-holidays/td-p/566988
Hi April, any tips in how to reset the calendar in case the user clicks the Back button and then come's back in? I noticed the OnSelect for the Clear button is blank
Hi Edirin, I was able to reset the calendar by adding the follow code in the Calendar component at onReset property (copy from tmrInitialize):
Set(_today,Today());
/* if default dates are provided, set to inputs, otherwise set to today */
Set(_selectedStart, If(!IsBlank(Calendar.DefaultStartDate), Calendar.DefaultStartDate, _today));
Set(_selectedEnd, If(!IsBlank(Calendar.DefaultEndDate), Calendar.DefaultEndDate, _today));
In the CalendarScreen / Clear button, just type Reset(Calendar_1), you might want to also add it at Type screen / NextArrow2 icon.
I am struggling with the details of creating the SP lists and the settings. For example 'Time Off Requests' Item 4 - Create a Choice Column called 'TimeOffType'. What goes in the 'Choice' lines when creating this field? Cheers
Could you set up the share point lists?
Nothing - leave them blank and the app will write to this column when you submit an entry
If you have a chance to include the screenshot or an excel file containing all SharePoint lists with column names and data types for this template, that would be a bonus help for :) Thanks
Could you share me your share point lists
Very new to Power Apps, downloaded and installed but missing "galleryTimeOffTypes.Items". Could I pay you to have a TEAMS meeting to setup?
Hey Nick - sorry for the delay in responding, I got behind on the comments here. Are you still having trouble? If so the best way to reach out to me for 1:1 help is my blog's contact form: sharepointsiren.com
Thank you for your vdo . please advise me how to set user currently approval by direct manager. Because when I set up everything complete I found that user current show all of manager and anyone can approve. I don't know how to fix it. Thank you in advance 🥰😍
You can get the current users manager with the Office365Users() Connector. There is a GetManager action that you can use and set that in a field in their time off request. Then you can filter the gallery for submitted requests to only show items where Manager = current user
@@AprilDunnam Thank you
how do we resolve this error? Invalid operation: division by zero
Can you please post an issue in my Github repo with this question and more details with screenshots? It would be helpful to know in what screen you're getting this on with screenshots of the error:
github.com/aprildunnam/PowerApps/issues
Great is it possible to add TOIL for accrue and use pls?
Hey Ginge - You should be able to handle that by adding an additional column for TOIL to the Time Off types and Time off Balances list
@@AprilDunnam thanks how about being able to include an add toil request pls.
May I ask why I am getting so many errors like: Name isn't valid. This identifier isn't recognized -- for the images -- so, I don't see any icons on the landing page. I just followed the instructions from github. :(
I am also getting an issue with the 'TimeOffType' lookup column (when creating Time Off Balances List)- it says lookup is already on this site. Then I realized tat a part of the steps in The Time Off Requests List is also 'TimeOffType'.
The images on the home page pull data from the SharePoint list. My guess is the list columns were provisioned without spaces and they need spaces in their names. Look at the Image property of that and see if you can change the field names in there to include spaces - that's probably the problem. (could be the other way around too where they don't need spaces)
@@AprilDunnam Hi, have the same issue. First had the column name without spaces (AllottedTime) as per github instructions, then created on with spaces, still the Name isnt valid. This identifier isnt recognized & Invalid use of '.' errors are there. Any ideas??
Figured it out, had forgotten to include the Allotted Time column in the lookup-thanks for the great template!!!
@@anthonyanyoti I have the same problem, but nothing seems to work, any ideas?
Don't you have to protect the sharepoint list?
You can use SharePoint's native permissions to lock down the lists according to your requirements.
Can I get the SVG code?
You can get that by downloading and installing the sample or pull it here from my sample solution's YAML. Just search for SVG and copy that : github.com/pnp/powerplatform-samples/blob/main/samples/leave-request/sourcecode/LeaveRequestTemplateDataverse/src/CanvasApps/src/ad_leaverequesttemplatedataverse_a8609/Src/Landing.fx.yaml
April, I am having slight problem with the date and time, powerapps showing wrong date and time, how to resolve this? thank you 😊
It could be a time zone issue, might need to use TimeZoneOffset. Where in the app is it not showing correctly and how far off is it?
@@AprilDunnam it plus 8 hrs, how do I configure it? thank you. all time not showing correctly at main, detail and edit page.
@@AprilDunnam it requires Microsoft Flow?
@@silverwhite11 have you checked the regional settings of your SharePoint site that the lists are stored on to make sure it's correct?
@@AprilDunnam the file is upload in onedrive. the time zone wasnt set correctly, I adjusted the time zone, refresh the data in powerapp, unfortunately the list time and date still not synchronise. do I need to redo the powerapps again? so that the time can resynch, or something else? thank you for your patience. 😊