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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Leave request type - C...
Power Apps
Unanswered

Leave request type - Changing or creating new types

(0) ShareShare
ReportReport
Posted on by

I'm trying to remove all types of requests and add only a 'Remote Work Request'. I changed the code as shown in the screenshot, but in the app, it shows -1 day. Also, when I open my 'Leave Balance' section, it's completely empty, and there is no 'Remote Work' part

 

Set(_sendEmailsEnabled, false);

Concurrent(
//collection used in the left nav menu
ClearCollect(EmployeeNavigation,
{MenuItem: "My Leave Requests"},
{MenuItem: "My Leave Balance"},


{MenuItem: "Log out"}),

//collection used in the left nav menu
ClearCollect(ManagerNavigation,
{MenuItem: "Leave Requests"},

{MenuItem: "Log out"}),

//add custom leave types to this collection to make them show up in the app
ClearCollect(
LeaveTypeCollection,
Table(
{
type:"Remote",
icon:Remote,
iconselected:'Remote-selected',
description:
"Remote work is provided to all employees, "
}


)
),
//defines leave start and end for requests. Default set to Now since most users will be creating new requests. Changes to reflect leave times for requests which are being edited
Set(_leaveStart,Now()),
Set(_leaveEnd,Now()),
Set(_myProfile,Office365Users.MyProfile()),
ClearCollect(EmailTemplate,
"<html>

<head>
<meta http-equiv=""Content-Type"" content=""text/html; charset=us-ascii"">
</head>

<body>
<p>
There is a leave request from: {SubmitterName} pending your approval. <ul><li>Type: {LeaveType}</li><li>Title: {LeaveTitle}</li><li>Description: {LeaveDescript}</li><li>Start Date: {LeaveStart}</li><li>End Date: {LeaveEnd}</li>" &
"</p>
</body>
</html>"
),
ClearCollect(HolidaysCollection,
{HolidayName: "Thanksgiving", StartDate: DateValue("11/22/2018")},
{HolidayName: "Day after Thanksgiving", StartDate: DateValue("11/23/2018")},
{HolidayName: "Christmas", StartDate: DateValue("12/25/2018")},
{HolidayName: "DayAfterChristmas", StartDate: DateValue("12/26/2018")},
{HolidayName: "New Year's Day", StartDate: DateValue("1/1/2019")})
);


ClearCollect(LeaveCollection,
{Title: "Vacation", Detail: "Example vacation request", StartDate: Today(), EndDate: DateAdd(Today(), 6, TimeUnit.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")});

ClearCollect(BalanceCollection,
{
EmployeeEmail: _myProfile.UserPrincipalName,
EmployeeName: _myProfile.DisplayName ,
Year: Text(Year(Now())),
Remote:25,
RemoteUsed:0,

BalanceID:_myProfile.UserPrincipalName&Text(Now(), "[$-en-US]mm-dd-yyyy-hh-mm-ss-fff")
}
)

Kamil141_0-1680171565367.pngKamil141_1-1680171669707.pngKamil141_2-1680171685232.png

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at

    Kamil141_0-1680181059397.png

    So I found the issue and fixed it. The only remaining issue is that it always shows 0

    Set(_sendEmailsEnabled, false);

    Concurrent(
    //collection used in the left nav menu
    ClearCollect(EmployeeNavigation,
    {MenuItem: "My Leave Requests"},
    {MenuItem: "My Leave Balance"},

    {MenuItem: "Log out"}),

    //collection used in the left nav menu
    ClearCollect(ManagerNavigation,
    {MenuItem: "Leave Requests"},

    {MenuItem: "Log out"}),

    //add custom leave types to this collection to make them show up in the app
    ClearCollect(
    LeaveTypeCollection,
    Table(
    {
    type:"Remote",
    icon:Remote,
    iconselected:'Remote-selected',
    description:
    "Remote leave is provided to all employees "
    }

    )
    ),
    //defines leave start and end for requests. Default set to Now since most users will be creating new requests. Changes to reflect leave times for requests which are being edited
    Set(_leaveStart,Now()),
    Set(_leaveEnd,Now()),
    Set(_myProfile,Office365Users.MyProfile()),
    ClearCollect(EmailTemplate,
    "<html>

    <head>
    <meta http-equiv=""Content-Type"" content=""text/html; charset=us-ascii"">
    </head>

    <body>
    <p>
    There is a leave request from: {SubmitterName} pending your approval. <ul><li>Type: {LeaveType}</li><li>Title: {LeaveTitle}</li><li>Description: {LeaveDescript}</li><li>Start Date: {LeaveStart}</li><li>End Date: {LeaveEnd}</li>" &
    "</p>
    </body>
    </html>"
    ),
    ClearCollect(HolidaysCollection,
    {HolidayName: "Thanksgiving", StartDate: DateValue("11/22/2018")},
    {HolidayName: "Day after Thanksgiving", StartDate: DateValue("11/23/2018")},
    {HolidayName: "Christmas", StartDate: DateValue("12/25/2018")},
    {HolidayName: "DayAfterChristmas", StartDate: DateValue("12/26/2018")},
    {HolidayName: "New Year's Day", StartDate: DateValue("1/1/2019")})
    );


    ClearCollect(LeaveCollection,
    {Title: "Vacation", Detail: "Example vacation request", StartDate: Today(), EndDate: DateAdd(Today(), 6, TimeUnit.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")});

    ClearCollect(BalanceCollection,
    {
    EmployeeEmail: _myProfile.UserPrincipalName,
    EmployeeName: _myProfile.DisplayName ,
    Year: Text(Year(Now())),Remote:13,
    Remote:100,
    RemoteUsed:0,


    BalanceID:_myProfile.UserPrincipalName&Text(Now(), "[$-en-US]mm-dd-yyyy-hh-mm-ss-fff")
    }
    )

  • Community Power Platform Member Profile Picture
    on at

    also fixed one question more how to remove this part 

    Kamil141_0-1680185996448.png

     

  • Community Power Platform Member Profile Picture
    on at

    another question , app don't save any data to excel ... any help??

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard