Hello,
After coming across the Leave Request template app, I'd like to adapt this to our organization's environment. First off, I'd like to change the data source from the default Excel file that is provided and use a SharePoint list instead. As I understand it, I would just have to use the same columns and data types and then adjust logic accordingly to read from the list. Just wanted to confirm in case there were any specifics that I'm missing. Anyone have experience doing so?
Thank you!
Solved! Go to Solution.
Hi @Brian-C :
Do you want to replace a SharePoint List with the original data source in the Leave Request template (a collection named LeaveCollection)?
If so,I suggest you follow these three steps:
Step1:Create a New SP List(All settings including listname must be exactly the same)
ListName:LeaveCollection
Column (click to edit) Type
Title | Single line of text |
Detail | Single line of text |
StartDate | Date and Time |
EndDate | Date and Time |
LeaveType | Single line of text |
Requester | Single line of text |
Approver | Single line of text |
Status | Single line of text |
LeaveIDAll settings including listname must be exactly the same | Single line of text |
Step2:Delete this code from the OnStart property of the app
ClearCollect(LeaveCollection,
{Title: "Vacation", Detail: "Example vacation request", StartDate: Today(), EndDate: DateAdd(Today(), 6, Days), LeaveType: "Vacation", Requester: _myProfile.UserPrincipalName, Approver: _myProfile.UserPrincipalName,
Status: "Pending", LeaveID: _myProfile.UserPrincipalName&Text(Now(), "[$-en-US]mm-dd-yyyy-hh-mm-ss-fff")});
Step3:Add the SP list just created as a data source
I think this link will help you a lot:
https://www.youtube.com/watch?v=_ECN8QWiNrQ
Best Regards,
Bof
Yes, you can switch it to use SharePoint instead of Excel, but it will take a good bit of work to switch everything over. Pay special attention to the spots where collections are created and where data is saved to the Excel file.
Hi @Brian-C :
Do you want to replace a SharePoint List with the original data source in the Leave Request template (a collection named LeaveCollection)?
If so,I suggest you follow these three steps:
Step1:Create a New SP List(All settings including listname must be exactly the same)
ListName:LeaveCollection
Column (click to edit) Type
Title | Single line of text |
Detail | Single line of text |
StartDate | Date and Time |
EndDate | Date and Time |
LeaveType | Single line of text |
Requester | Single line of text |
Approver | Single line of text |
Status | Single line of text |
LeaveIDAll settings including listname must be exactly the same | Single line of text |
Step2:Delete this code from the OnStart property of the app
ClearCollect(LeaveCollection,
{Title: "Vacation", Detail: "Example vacation request", StartDate: Today(), EndDate: DateAdd(Today(), 6, Days), LeaveType: "Vacation", Requester: _myProfile.UserPrincipalName, Approver: _myProfile.UserPrincipalName,
Status: "Pending", LeaveID: _myProfile.UserPrincipalName&Text(Now(), "[$-en-US]mm-dd-yyyy-hh-mm-ss-fff")});
Step3:Add the SP list just created as a data source
I think this link will help you a lot:
https://www.youtube.com/watch?v=_ECN8QWiNrQ
Best Regards,
Bof
When I was going through the OnStart code, I noticed this code was not present
ClearCollect(LeaveCollection, {Title: "Vacation", Detail: "Example vacation request", StartDate: Today(), EndDate: DateAdd(Today(), 6, Days), LeaveType: "Vacation", Requester: _myProfile.UserPrincipalName, Approver: _myProfile.UserPrincipalName, Status: "Pending", LeaveID: _myProfile.UserPrincipalName&Text(Now(), "[$-en-US]mm-dd-yyyy-hh-mm-ss-fff")});
When I check the Leave Balance Screen, I notice the gallery has the source of RequesterBalanceCollection, and I'm not sure where the app is initializing that. I did create a SP List with the columns specified. Do I have to add the SP List to a new collection then?
Hi @Brian-C :
Q1:About this code
ClearCollect(LeaveCollection,
{Title: "Vacation", Detail: "Example vacation request", StartDate: Today(), EndDate: DateAdd(Today(), 6, Days), LeaveType: "Vacation", Requester: _myProfile.UserPrincipalName, Approver: _myProfile.UserPrincipalName,
Status: "Pending", LeaveID: _myProfile.UserPrincipalName&Text(Now(), "[$-en-US]mm-dd-yyyy-hh-mm-ss-fff")});
It is indeed in the OnStart property
Q2:About RequesterBalanceCollection
You can find the relevant code in the "Keep balance visible on screen" property
Best Regards,
Bof
Hi @v-bofeng-msft ,
I was able to find and modify the variables and collections accordingly. Thanks for the guidance here!
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
256 | |
254 | |
83 | |
40 | |
30 |
User | Count |
---|---|
311 | |
265 | |
122 | |
65 | |
48 |