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

Creating a "Run Once" Daily Trigger using Power Automate

Creating a "Run Once" Daily Trigger using Power Automate

 

Scenario:

You have a triggered action that you wish to alert a user about. However, you only want to alert them the first time the action happens every day. You do not know when the triggered action will occur during the day, if at all, and the alert must be sent immediately.

 

Solution:

In order to achieve this we need to start with our trigger. You can trigger your Flow from any automatic action that you wish but for this example we will use the Common Data Service and trigger when an Account record is created.

 

chrome_2020-01-24_10-02-25.png

 

To keep things simple we will now simply add a Send me an email notification action.

 

chrome_2020-01-24_10-03-47.png

 

Give your Flow a name and save.

 

Now we are going to perform the necessary action required to trigger our Flow. In this case, we will create an Account record in CDS. You should see your Flow run successfully and receive the notification.

 

chrome_2020-01-24_10-06-58.png

 

OUTLOOK_2020-01-24_10-08-02.png

 

Great! But what if we now create another Account? Each time an Account record is created (or your trigger condition is met) the Flow will execute. In order to ensure that this Flow only runs a single time we can add a final action to the process.

 

Navigate back to your Flow and edit it. Add the Flow Management action Turn Off Flow. Select the environment where your Flow exists and the Flow itself from the drop down controls. Your complete process should look like this.

 

chrome_2020-01-24_10-11-48.png

 

If we perform our triggering action again and create a new Account record in CDS our Flow will run as expected, and then turn itself off. Any subsequent Accounts that are created will not trigger the Flow as it is no longer switched on.

 

The final piece of the puzzle is to automate the turning on of the Flow as we don't want to have to remember to re-enable it every day! Create a second Flow with a Recurrence trigger set to run with an interval of 1 and a frequency of day. You can pick any time of day that suits you but ideally it should be early enough in the day to run BEFORE the first triggering action (Account being created) occurs. For this example, we will set to 1am.

 

chrome_2020-01-24_10-18-20.png

 

Add a single action to this Flow, the Flow Management Turn on Flow action. Set the properties to the Flow that we created previously (the one that turns itself off).

 

chrome_2020-01-24_10-20-40.png

 

Save this flow and the process is now complete.

 

The next time the triggering action occurs and an Account is created, our automated Flow will trigger and send the email notification before turning itself off. Any subsequent Accounts created on the same day will not be able to trigger the notification as the Flow will be turned off. At 1am the following day, the Recurrence flow will run and turn the Account trigger Flow back on ready to be triggered again.

About the Author
  • Experienced Consultant with a demonstrated history of working in the information technology and services industry. Skilled in Office 365, Azure, SharePoint Online, PowerShell, Nintex, K2, SharePoint Designer workflow automation, PowerApps, Microsoft Flow, PowerShell, Active Directory, Operating Systems, Networking, and JavaScript. Strong consulting professional with a Bachelor of Engineering (B.E.) focused in Information Technology from Mumbai University.
  • I am a Microsoft Business Applications MVP and a Senior Manager at EY. I am a technology enthusiast and problem solver. I work/speak/blog/Vlog on Microsoft technology, including Office 365, Power Apps, Power Automate, SharePoint, and Teams Etc. I am helping global clients on Power Platform adoption and empowering them with Power Platform possibilities, capabilities, and easiness. I am a leader of the Houston Power Platform User Group and Power Automate community superuser. I love traveling , exploring new places, and meeting people from different cultures.
  • Read more about me and my achievements at: https://ganeshsanapblogs.wordpress.com/about MCT | SharePoint, Microsoft 365 and Power Platform Consultant | Contributor on SharePoint StackExchange, MSFT Techcommunity
  • Encodian Owner / Founder - Ex Microsoft Consulting Services - Architect / Developer - 20 years in SharePoint - PowerPlatform Fan
  • Founder of SKILLFUL SARDINE, a company focused on productivity and the Power Platform. You can find me on LinkedIn: https://linkedin.com/in/manueltgomes and twitter http://twitter.com/manueltgomes. I also write at https://www.manueltgomes.com, so if you want some Power Automate, SharePoint or Power Apps content I'm your guy 🙂
  • I am the Owner/Principal Architect at Don't Pa..Panic Consulting. I've been working in the information technology industry for over 30 years, and have played key roles in several enterprise SharePoint architectural design review, Intranet deployment, application development, and migration projects. I've been a Microsoft Most Valuable Professional (MVP) 15 consecutive years and am also a Microsoft Certified SharePoint Masters (MCSM) since 2013.
  • Big fan of Power Platform technologies and implemented many solutions.
  • Passionate #Programmer #SharePoint #SPFx #M365 #Power Platform| Microsoft MVP | SharePoint StackOverflow, Github, PnP contributor
  • Web site – https://kamdaryash.wordpress.com Youtube channel - https://www.youtube.com/channel/UCM149rFkLNgerSvgDVeYTZQ/