Leave request xPath

1
Hi, Experts I want get the Current month depends on the from date of the user in the leave request give me the solution Depends upon the from date i want to find the current month and to calculate the total no of leave  request taken by the user in the month   
asked
1 answers
1

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.

 

answered