cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Brian-C
Frequent Visitor

Leave Request - Changing Data Source

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!

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

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

TitleSingle line of text
DetailSingle line of text
StartDateDate and Time
EndDateDate and Time
LeaveTypeSingle line of text
RequesterSingle line of text
ApproverSingle line of text
StatusSingle line of text
LeaveIDAll settings including listname must be exactly the sameSingle 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

1.JPG1.JPG

I think this link will help you a lot:

https://www.youtube.com/watch?v=_ECN8QWiNrQ

Best Regards,

Bof

 

View solution in original post

5 REPLIES 5
Pstork1
Dual Super User III
Dual Super User III

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.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
v-bofeng-msft
Community Support
Community Support

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

TitleSingle line of text
DetailSingle line of text
StartDateDate and Time
EndDateDate and Time
LeaveTypeSingle line of text
RequesterSingle line of text
ApproverSingle line of text
StatusSingle line of text
LeaveIDAll settings including listname must be exactly the sameSingle 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

1.JPG1.JPG

I think this link will help you a lot:

https://www.youtube.com/watch?v=_ECN8QWiNrQ

Best Regards,

Bof

 

View solution in original post

Hi @v-bofeng-msft 

 

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?

 

rc2.png

 

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

1.JPG

Q2:About RequesterBalanceCollection

You can find the relevant code in the "Keep balance visible on screen" property

2.JPG

Best Regards,

Bof

Hi @v-bofeng-msft ,

 

I was able to find and modify the variables and collections accordingly. Thanks for the guidance here!

 

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (68,163)