Skip to main content

Notifications

Power Automate - General Discussion
Unanswered

Wrong in approval flow

(0) ShareShare
ReportReport
Posted on by 34

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

  • v-yamao-msft Profile Picture
    v-yamao-msft on at
    Re: Wrong in approval flow

    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

     

  • mohamed Profile Picture
    mohamed 34 on at
    Re: Wrong in approval flow

    when i press save this photo appear to me 

    Capture.JPG

  • v-yamao-msft Profile Picture
    v-yamao-msft on at
    Re: Wrong in approval flow

    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

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,304

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,703

Leaderboard