Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
Answered

Do Until not be correct

(0) ShareShare
ReportReport
Posted on by 26

I have a little problem with my flow and hope someone can help me.

The workflow is started as soon as someone adds a new entry in the calendar.

Captured are Start and End.

He should pay the days and put in a variable.

For more than 5 days an approval should be started. For less than 5 days, the entry should be added.

Unfortunately, he does not work the way I would like to.

As seen in the example, the loop runs for 4 days longer than it has to and thus goes into the Approval.

What am I doing wrong.

here my flow:

 

flow_1.pngflow_2.pngflow_3.pngflow_4.pngflow_5.pngflow_6.png

flow_1.png

 

 

 

 

 

 

 

 

 

 

 

for the best Example i add a running flow with content to it.

start when create new entry in calandar

 

1_Start date.png

 

2_End Date.png

Variable intialize

 

3_init Variable.png

 

4-init Variable 2.png

 

 

5_compose 4.png

 

6_declaration Variable.png

 

7_do until_1.png

here is my problem, the loop does not recognize the termination point

8_do until_2.png

 

9-array filter .png

 

10_Bedingung.png

Thus, the conditions are also not correct and he runs into the approval.
Does anyone have an idea why this might be.

 

 

 

 

  • Verified answer
    pit850 Profile Picture
    26 on at
    Re: Do Until not be correct

    Thanks for your Support, 

    I think I was a little bit awkward.
    Now he is running
  • v-zhos-msft Profile Picture
    on at
    Re: Do Until not be correct

    Hi @pit850 ,

    First, when you add the date from Sharepoint to flow, the time zone will changed from UTC to your location.

    So I am afraid you need to convert the date to UTC to get the original time.

    I suggest you add 5 days to the Start time, then check the date whether greater than End time.

    I have made a test on my side, please take a try with the following workaround:

    The expression in Compose and  Compose 2 are: to format the date.

    formatDateTime(triggerBody()?['EventDate'],'yyyy-MM-dd HH:mm:ss')
    formatDateTime(triggerBody()?['EndDate'],'yyyy-MM-dd HH:mm:ss')
    The expression in Compose 3 and  Compose 4 are: to get the original time.
    convertToUtc(outputs('Compose'),'China Standard Time')
    convertToUtc(outputs('Compose_2'),'China Standard Time')
    The expression in Compose 5: to add 5 days to Start time.
    addDays(outputs('Compose_3'),5)

    Capture.PNGCapture1.PNG

    Best Regards,

    Community Support Team _ Zhongys

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,679 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,015 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow