Power Platform is for citizen developers. For Power Users who are masters of their business process but lacks the technical background to build an application out of that knowledge, Power platform have provided a level playing field.
Last few posts, I wrote based requests of enthusiastic citizen developers. This is one more query I received from one such enthusiastic developer who have just started exploring the world of Power Platform.
The requirement is very simple. We need to determine within a Power Automate flow if today is the starting date of the month. But how do we do it?
To demonstrate this, I created an instant cloud flow. As a first step, I initialized a string variable
- Name : StartOfMonth
- Type : string
- Value: startOfMonth(utcNow(), ‘dd/MM/yyyy’)
The format specified in the value can be anything. Really does not matter. However what is important here is the function – startOfMonth where I am passing the current date and time as the first parameter
In the next step, I will compare current date with the variable value from earlier step. Observe I have used the formatDateTime function with the same date format used earlier to make sure we have the correct comparison.
formatDateTime(utcNow(), 'dd/MM/yyyy')
Basically, you could have done all in a single expression instead of declaring a variable. But for simplicity I used this route. Execute the flow. And below is the result of flow run.
As of writing this blog, today’s date is 29 day of March, 2021. Quite understandably, the expression result of the condition statement is false. But what is important here is the output result of startOfMonth expression.
You may also like the below posts.
Hope this helped!
Debajit Dutta
Business Solutions MVP
Discover more from Debajit's Power Apps & Dynamics 365 Blog
Subscribe to get the latest posts sent to your email.