Hi Sankar,
1. Create a microflow or a nanoflow to handle this calculation.
2. Retrieve the "from" date from the ’MyLeaveRequest’ entity.
3. Use the `parseDateTime` function to extract the month value from the "from" date. The expression would be something like
parseDateTime($LeaveRequest/FromDate, 'M')
.
4. Compare the extracted month value with the current month. You can use the `formatDateTime` function to get the current month's value in the same format as the "from" date. The expression would be something like
formatDateTime(currentDateTime(), 'M')
5. Create a variable to keep track of the total number of leave requests taken in the current month. Initialize it to 0.
6. Iterate through the leave requests associated with the user and increment the count variable for each leave request that falls within the current month. You can use a loop and a decision split to check if the month value from the "from" date matches the current month value.
7. Display or use the count variable as needed in your application.