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 Automate / Calculating Total Leav...
Power Automate
Unanswered

Calculating Total Leave and Remaining Leave

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi All,

 

My problem is, I just want to display the total leave and remaining leave of employee. The total leave of one employee is 10 and every time manager approves their request remaining leave become 9.

 

I used expression like this sub([total leave], 1) it subtract by 1 and become 9. But when I apply again for leave the flow become the same.

 

How can I get the updated 9 remaining leave? I think to use this code if EMPLOYEE ID = EMPLOYEE NAME then get the remaining leave so the remaining leave become accurate to the employee but I dont know where I should input that.

 

Suggestion guys thanks.

1.PNG

 

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

    Hi @Anonymous,

     

    Could you please share a screenshot of the configuration of your flow?

     

    Please take a try with expression sub([remaining leave], 1)  instead of sub([total leave], 1)

     

    Best regards,

    Alice

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This is my flow sub.JPG

  • v-yuazh-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    Please take a try with expression sub([remaining leave], 1)  instead of sub([total leave], 1)

     

    Please make sure the Initial value of REMAINING LEAVE should be the same as total leave.

     

    If the dynamic content is from the trigger, the expression should be:

    sub([triggerBody()?['REMAINING_x0020_LEAVE'], 1)

     

     

    Best regards,

    Alice

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @v-yuazh-msft,

     

    Same thing, I sub and became 9.

     

    How can I get the remaining leave 9 if I apply again for request? Thanks.

  • v-yuazh-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    Please share a full screenshot of the configuration of your flow.

     

    I couldn't understand you for "get the remaining leave 9",do you want to get the newest remaining leave after the remaining leave is sub 1?

    If you want to get the newest remaining leave after the remaining leave is sub 1,you could add a Compose unser the "Update item" action , and then insert the REMAINING LEAVE dynamic content of the "Update item" action in the Compose field.

     

     

    Best regards,

    Alice

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This is the result.

     

    22.JPG

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 Automate

#1
Haque Profile Picture

Haque 573

#2
Valantis Profile Picture

Valantis 407

#3
11manish Profile Picture

11manish 387

Last 30 days Overall leaderboard