cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

Wrong in approval flow

hello

i have list forEmployee Vacation  21 days in year when employee leave request for vacation if number or days less than or equal   21  send approve  

i make 3 column 1 = from date  

                            2 = to date  

                            3= calculated column to calculate number between two date 

0111.JPG

but flow cant see the number of days in calculated column in condition flow

i make variable to put calculated column in it and put output in condition 

flow run when the  21 days finish flow give me 0 but when i make another request flow cant see the conditon and send approve and give me number -9  how can i solve this problem 

0.JPG01.JPG

3 REPLIES 3
Community Support
Community Support

Hi @mohamed,

 

Thanks for providing more detail at here.

Flow will consider calculated column as text, so if you want to compare a calculated column with certain number, you may need to convert it to a string.

If you want to send an approval request when the total vacation days are less than or equal to 21 days. Instead of using Get items, please check the following configuration for a reference.

First, create a list includes columns Date (date and time), Date2 (date and time), and Days (calculated column).

1.PNG

Trigger the flow by When an item is created or modified.

Add a Compose action with the following code to convert Days into a string:

int(triggerBody()?['Days'])

Add a Condition to check if the Compose output is less than or equal to 21.

Under if yes branch, start an approval with details of leave request. Under if no branch, send an email to the requestor.

2.PNG

Please take a try with it and feel free post back if you need more help.

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

when i press save this photo appear to me 

Capture.JPG

Hi @mohamed,

 

It seems that you have multiple actions of Update items.

As your flow is triggered by When an item is created or modified, so whenever an item is created or modified, the flow will be triggered. While the action Update item will update the list, which will result in an infinite trigger loop.

Please consider adding another Condition under the trigger to check if the triggered item matches certain condition.

I have made the following test for your reference:

1.PNG 

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Users online (3,608)