Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
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

 

  • Community Power Platform Member Profile Picture
    on at
    Re: Calculating Total Leave and Remaining Leave

    This is the result.

     

    22.JPG

  • v-yuazh-msft Profile Picture
    on at
    Re: Calculating Total Leave and Remaining Leave

    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
    Re: Calculating Total Leave and Remaining Leave

    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
    Re: Calculating Total Leave and Remaining Leave

    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
    Re: Calculating Total Leave and Remaining Leave

    This is my flow sub.JPG

  • v-yuazh-msft Profile Picture
    on at
    Re: Calculating Total Leave and Remaining Leave

    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

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

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,618 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 65,948 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow