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

Calculating Total Leave and Remaining Leave

(0) ShareShare
ReportReport
Posted on by

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
    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
    on at

    This is my flow sub.JPG

  • v-yuazh-msft Profile Picture
    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
    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
    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
    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

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 Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard