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 / Problem with adding py...
Power Automate
Unanswered

Problem with adding python code to calculate leave days from a form and update this information on a shareable excel on power automate

(0) ShareShare
ReportReport
Posted on by

Hi,

I have created a simple leave management flow that is triggered when a person fills out a form and submits it, the details on the form includes the dates at which he or she will start his or her leave when he or she returns and a few other details like the type of leave they are taking and the reason, once they have submitted the form the flow is triggered and the next step is an approval stage where the hr or a supervisor is sent an approval notification email specifying who took the leave and the dates they plan to start and return, now at this stage they can reject or approve if they reject then a notification is sent over to the person taking the leave informing him of the decline. if approved the flow goes to the second stage of informing the person taking the leave that their leave has been approved, once this happens the third stage starts but this is where I am having a challenge I need a way of calculating the leave days taken this is from the form they filled while excluding the weekends, and also fill out a  shareable excel with the following information, this is the name, the department, the leave type, start date, leave days taken, Total leave days allocated, This is predefined for me is 21 days, and the leave reminder. I have created the Excel sheet or the create a table in Excel step in the flow but the calculation is giving me a headache as this Excel will be used by the supervisors to store the date of who has taken leave day and the number of leave days they have left and the mentioned details, please help me out I have spent months trying to see if I can solve this but I haven't been successful so kindly please help, I have attached a zip file containing the flow if you need any information feel free to let me know 

Categories:

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 237 Super User 2026 Season 2

#2
David_MA Profile Picture

David_MA 227 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 194

Last 30 days Overall leaderboard