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 Management App -...
Power Apps
Answered

Leave Management App - Sharepoint List Data Sources

(0) ShareShare
ReportReport
Posted on by

Hi all,

 

I'm experimenting with the Request Leave Template app on powerapps, however I've recreated the collections in the app to a sharepoint list,

 

That done I have an issue with some functions used in the app, I can't recreate the same for a sharepoint list, specifically this:

 

Home screen: On Visible:

Concurrent(
 Set(
 _navMenuSelect,
 "My Leave Requests"
 ),
 //if not manager view, refresh my balance collection when on this screen
 If(
 !_managerView,
 Set(
 _requesterBalanceRecord,
 LookUp(
 'Leave Balance',
 Year = Text(Year(Now())) && Email = _myProfile.UserPrincipalName
 )
 );
 ClearCollect(
 RequesterBalanceCollection,
 {
 Title: "Vacation",
 balance: "Vacation" - "Vacation Used"
 },
 {
 Title: "Sick Leave",
 balance: "Sick Leave" - "Sick Leave Used"
 },
 {
 Title: "Floating",
 balance: Value(_requesterBalanceRecord.Floating) - "Floating Used"
 },
 
 {
 Title: "Bereavement",
 balance: Value(_requesterBalanceRecord.Bereavement) - Value(_requesterBalanceRecord.'Bereavement used')
 }
 
 )
 ),
 Set(
 _showDetails,
 false
 )
);

How do I modify the clearcollect segment, to update the SharePoint list, it has the same type of columns as the collection,

 

Any help will be highly appreciated.

 

TIA

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

    Hi @Dk4 ,

    What do you mean about " modify the clearcollect segment, to update the SharePoint list"?

    • Do you want to use the RequesterBalanceCollection to update the SharePoint List?
    • What is the SharePoint list’s data structure(column name and column type)?

    Could you please provide more information about your requirement?(Some screenshots better).

    I assume you want to use the RequesterBalanceCollection to update the SharePoint List, so I do a simple test on my side for reference:

    1. Create a new list called “LeaveRequest2” to keep the leave requests.

    2. Go to NewRequestScreen and set OnSelect property of "Submit request" button to(just add a Patch() function):

    Patch(LeaveRequest2,Defaults(LeaveRequest2),{Title:NRLeaveTypeLabel.Text,balance:LookUp(RequesterBalanceCollection,type=NRLeaveTypeLabel.Text).balance,Requester:User().FullName});

    v-albai-msft_0-1613633531953.png

    See results below. When some user submit a sick leave, his request information will update into the SP. Note: the balance value is the value before approving. You can also edit your formula to display new balance in your list.

    v-albai-msft_1-1613633531960.png

    v-albai-msft_2-1613633531962.png

    Best Regards,

    Allen

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
Vish WR Profile Picture

Vish WR 633

#2
11manish Profile Picture

11manish 588

#3
Valantis Profile Picture

Valantis 457

Last 30 days Overall leaderboard