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

Recurring Loop

I have a flow that was created by the previous developer.  The flow has an error that I am trying to fix, but I am having trouble understanding what the last guy did.

 

The flow was written to create recurring events on a SharePoint list.  The flow does create the recurring entries on the correct date, but the time if wrong.  For example, there is an event every Friday from 8am to 9am.  The first entry for this event is correct on SharePoint, but the entry for next Friday will have something like 9am to 3am for the time.  

 

This is the flow:

Flow Part 1.pngFlow Part 2.pngFlow Part 3.pngFlow Part 4.png

 

The function for the StartDate addToTime is 

addToTime(variables('StartDate'), mul(variables('RecurInterval'),variables('Recur')),'Day')

 

 

The function for the EndDate addToTime is 

addToTime(variables('EndDate'), mul(variables('RecurInterval'),variables('Recur')),'Day')

 

 

Below the EndTime Compose there is a Create Item action that uses the output from the StartDate and EndDate Compose.  Because of this, I am assuming there is a problem with the addToTime code, but I can't figure it out. 

 

Please help me fix this flow.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

I am going to mark this response as the solution, but it is not.  I have a better understanding of the problem, but it is still on going.  So, the purpose of this post is to summarize this topic.

 

The flow that I posted does work to create multiple items on a certain date based on the recurrence type of weekly, bi-weekly, or monthly, but it does not create these items with the current time.  Adding a time zone converter using UTC for the start and end times did correct this problem but it does not account for Daylight Saving Time.  So, the flow only worked from March through November.  The start and stop times are one hour behind when DST is not in effect.  I then added another set of time zone converters using UTC -01:00 which would have worked if I knew how to write the flow to switch from the UTC time zone converters to the UTC -01:00 converters at the end of DST.  This is where things went crazy.  I tried to add a condition that checked the start date of an item to determine which time zone converter to use.  If the date was between 12 March and 4 November, the flow would use UTC.  If not, it would use UTC -01:00.  Sounds like a simple condition that should have worked, but something caused an infinite loop and it kept going for two and half days before @annajhaveri told me to look for flows that are still running.  Once I cancelled all the running flows, SharePoint still created about 300 items on the list.  I am assuming this was the last of the incoming Power Automate requests in the queue.  Approximately 20,810 items were created on the SharePoint list because of this looping issue.      

 

I am done trying to make this flow work.  Even if I was able to make it work for 2023, it would not work in 2024 because DST start and end dates are different.  Right now I am trying to convince the company to use a SharePoint calendar instead of this.        

 

** I did not post screenshots of the bi-weekly and monthly parts of the flow.  If someone wants to see it, tag me in a reply.

View solution in original post

7 REPLIES 7
annajhaveri
Most Valuable Professional
Most Valuable Professional

@Alex-W  the flow is manually creating recurring items in SharePoint list? You can use recurrence feature of SharePoint Calendar for recurrence, here is a blog that can get you started on how to create recurring calendar item in SharePoint https://www.expiscornovus.com/2022/02/28/how-to-create-a-recurrent-event/

 

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

@annajhaveri I 100% agree with you.  The SharePoint calendar has the recurrence feature that works, but for unknow reasons at this time, the guy before did not use a calendar.  The flow I posted above is attached to a SharePoint list that is creating the recurring items.

 

I did make some progress on this issue.  I added a time zone conversion actions for the start and stop date and that sort of works.  Future start/ends time match the actual time until November 4 when the clocks change due to daylight saving time.  The time conversion is going from local (source time zone) to UTC (destination time zone).  I thought the source and destination time zones would be the other way around, but that did not work.  I also thought Power Automate would account for the daylight saving time, but it does not appear that way.  Starting 5 November, all the recurring event entries are one hour behind and then goes back to actual time in March when the clocks change again.  

 

Going forward, I will try to convince the company to switch to the classic calendar. 

So I have a new problem now.  Instead of attempting to convince the company to switch to the SharePoint calendar, I decided to try to make the flow work while accounting for daylight saving time.  This did not work out as planned and the flow went into an infinite loop which caused a throttling warning.  I spent about 10 minutes deleting the recurring entries, but they kept coming.  I reverted the flow back to the way it was and that did not stop the recurring entries.  Turning off the flow did not stop them either.  I ended up adding a trigger condition.  That stopped the flow from running, but the recurring entries are still being created. 

 

This is my first experience with throttling.  I am assuming SharePoint is not allowing all the recurring entries to be created in a short period of time, but its been almost 13 hours now and recurring entries are still being created on the SharePoint list.  

 

If this problem does not stop soon, is there another way to stop the recurring entries from being created? 

 

I do not have tenant admin permissions and there isn't a duplicate flow.  

annajhaveri
Most Valuable Professional
Most Valuable Professional

@Alex-W  is there any flow run, that is  in progress?

Regards,
Anna Jhaveri

If I have answered your question, please mark the post as Solved to help other users to identify the correct answer
If you like my response, please give it a Thumbs Up.

@annajhaveri I think you are on to something.  That is a great question and one I did not think about.  I am looking at the run history now and there are flows still running.  It does not allow me to do a select all and cancel flow runs.  So I will have to do a few at time.  I will reply again once I cancel all of them.  

@annajhaveri Problem solved!!  I had quite a few flows running and it took me a long time to stop them all.  It seems like each time the looping flow ran, it created another looping flow.  Since Monday when this problem start, over 20,000 items were created on the SharePoint list.  This is the craziest thing I've seen with Power Automate, but I now know what to do if this happens again.  Thank you for all your help!!!

I am going to mark this response as the solution, but it is not.  I have a better understanding of the problem, but it is still on going.  So, the purpose of this post is to summarize this topic.

 

The flow that I posted does work to create multiple items on a certain date based on the recurrence type of weekly, bi-weekly, or monthly, but it does not create these items with the current time.  Adding a time zone converter using UTC for the start and end times did correct this problem but it does not account for Daylight Saving Time.  So, the flow only worked from March through November.  The start and stop times are one hour behind when DST is not in effect.  I then added another set of time zone converters using UTC -01:00 which would have worked if I knew how to write the flow to switch from the UTC time zone converters to the UTC -01:00 converters at the end of DST.  This is where things went crazy.  I tried to add a condition that checked the start date of an item to determine which time zone converter to use.  If the date was between 12 March and 4 November, the flow would use UTC.  If not, it would use UTC -01:00.  Sounds like a simple condition that should have worked, but something caused an infinite loop and it kept going for two and half days before @annajhaveri told me to look for flows that are still running.  Once I cancelled all the running flows, SharePoint still created about 300 items on the list.  I am assuming this was the last of the incoming Power Automate requests in the queue.  Approximately 20,810 items were created on the SharePoint list because of this looping issue.      

 

I am done trying to make this flow work.  Even if I was able to make it work for 2023, it would not work in 2024 because DST start and end dates are different.  Right now I am trying to convince the company to use a SharePoint calendar instead of this.        

 

** I did not post screenshots of the bi-weekly and monthly parts of the flow.  If someone wants to see it, tag me in a reply.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (1,522)