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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Leave request template
Power Apps
Unanswered

Leave request template

(0) ShareShare
ReportReport
Posted on by 5

Hi everyone, first of all, sorry for my English, if it can called that. I'm newcomer ussing powerapps and I trying to implement this app to be used by my department. If you don't notice yet, I'm Spanish and must translate the entire app. Once this is done I have encountered two issues, firstly the data source don't store the new leave request, I've tried to reconnect data source but doesn't work, not update the data that I was introduced in the app like as holiday collection or balance. I would like to store the data source in SP list, but I don't know how to do it.

 

Secondly I need to approval in two steps, first by line manager, user must not be notified and status not changed, second by manager when the user must be notified.

 

Thanks in advance 

 

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @miguelits ,

    Do you make this template app as your own app (click "Make my own app" button)?

     

    For your first question, have you made this template app as your own app? Do you want to save your new Leave Request into the LeaveCollection?

    On your side, you should make this template app as your own app firstly via clicking "Make my own app" button. Actually, when you submit a new leave request, the new submitted request would be saved into the LeaveCollection collection (same as BalanceCollection and HolidayCollection). The LeaveCollection collection (same as BalanceCollection and HolidayCollection) is initialized within the OnStart property of the App control as below:3.JPG

    If you want to save the new submitted leave request into your SP list, you must add same columns as that in the LeaveCollection within your SP list. The data structure should be as below:4.JPG

    then add your SP list as a data source within your app instead of LeaveCollection collection. If you want to save your new leave request into your SP list, please modify the formula within the OnVisible property of the ConfirmationScreen to following:

     

    If(_submittingRequest,
     Concurrent(
     Set(_navMenuSelect, ""), 
     //if editing a request, revise the record that is being edited, otherwise create a new one 
     Patch("YourSPList", If(_editingRequest, LookUp("YourSPList", LeaveID = GalleryRequests.Selected.LeaveID), Defaults("YourSPList")), /* <-- Please replace LeaveCollection with your SP List data source here */
     {
     Title: TextInput1.Text,
     Detail: TextInput1_1.Text,
     StartDate: LeaveStartDatePicker.SelectedDate,
     EndDate: LeaveEndDatePicker.SelectedDate,
     LeaveType: _selectedLeaveType.type,
     Approver: _selectedApprover.UserPrincipalName,
     Status: "Pending",
     Requester: _myProfile.UserPrincipalName,
     LeaveID: If(_editingRequest, GalleryRequests.Selected.LeaveID, Text(Now(), DateTimeFormat.LongDateTime24) & _myProfile.UserPrincipalName)
     }
     ),
     //create email template data specific to the request
    ...
    ...
    ...

     

     

    For your second question, do you want the request the user made to be approved by two managers? Based on the needs that, I think you need to custom your app.

    I think you need to add another column (Approver2) within your SP list to store the second Approver email. Then when the second approver approve the request, the user would be notified.

     

    Best regards,

  • miguelits Profile Picture
    5 on at

    I will answer your questions

    I made my own app, but the new request did't store anything at LeaveCollection collection and neither in Leave data source sheet on excel file stored in OneDrive for Business. I think that it should be the correct way, ins't true?

    I make the change that you suggest, I created a SP list, add as a data source and modify the ConfirmationScreen, now the problem is that nothing is shows at HomeScreen and shows a warning 

     

    warning.PNG

     

    The warning says something like problably the result of formula Filter does not work correctly with bi data source. Maybe the data source can't process the formula and result of data set is incomplete.

     

    It's looks like I must make more change along the app 

     

    In my second question I think that add one column with approver2 is not enought to make approval in two steps. I need to get that when the first approver approves the request, notify the second approver that they have a pending request and this approves the request and notifies the user

    Can you help me to going in the correct way?

     

     

  • miguelits Profile Picture
    5 on at

    Hi @v-xida-msft 

     

    I test your solutions but I have new issues that I don't know to solve

    I created a SP list to save and store the new requests but I don't know what I have to do to show the new record at HomeScreen.

    How do I replace the collection LeaveCollection in OnStart App if I wasn't use it without new crashes in the entire app.

    I'm not a developer, maybe that's hard for me to undertand the app and powerapps in general. I'm just system administrator with curiosity.

     

    Thanks in advance

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard