{"id":26881,"date":"2021-02-22T09:39:19","date_gmt":"2021-02-22T09:39:19","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=26881"},"modified":"2021-02-23T11:14:24","modified_gmt":"2021-02-23T11:14:24","slug":"quick-tip-how-to-find-next-month-and-previous-month-using-microsoft-flow-within-dynamics-365-crm","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2021\/02\/quick-tip-how-to-find-next-month-and-previous-month-using-microsoft-flow-within-dynamics-365-crm\/","title":{"rendered":"How to Find Next Month and Previous Month using Power Automate within Dynamics 365 CRM"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p style=\"text-align: justify;\">In this blog, we are checking how we can calculate the next\/previous month\u2019s date time from today\u2019s date time or calculate the next\/previous month\u2019s date time from the selected date.<\/p>\n<p style=\"text-align: justify;\">There is no direct way or predefined function to calculate the next\/previous month in Power Automate. However, we can achieve this process using the Add to time action. Following input parameters we need to provide Add to time action:<\/p>\n<p>1. Base Time \u2013 It is the Date-Time value from where we add next month.<br \/>\n2. Interval \u2013It is a numerical value that specifies how many months we want in Base Time.<br \/>\n3. Time Unit \u2013 It is a list of Time Units (Month, Week, Day, Hour, Minutes, and Seconds) which specify on which Time Unit we want to add Interval.<\/p>\n<p style=\"text-align: justify;\">To understand more about the above parameters, let\u2019s try this scenario in Dynamic 365 CRM.<\/p>\n<p style=\"text-align: justify;\">Step 1:We create one Microsoft Flow and set that Flow Trigger on creating an Account entity record.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-26876 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/1-find-next-month-and-previous-month-using-microsoft-flow.jpeg\" alt=\"Find next month and previous month using Microsoft flow\" width=\"1347\" height=\"653\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/1-find-next-month-and-previous-month-using-microsoft-flow.jpeg 1347w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/1-find-next-month-and-previous-month-using-microsoft-flow-300x145.jpeg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/1-find-next-month-and-previous-month-using-microsoft-flow-768x372.jpeg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/1-find-next-month-and-previous-month-using-microsoft-flow-1024x496.jpeg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/1-find-next-month-and-previous-month-using-microsoft-flow-660x320.jpeg 660w\" sizes=\"(max-width: 1347px) 100vw, 1347px\" \/><\/p>\n<p style=\"text-align: justify;\">Step 2: Add \u201cAdd to time\u201d action with the following values<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-26877 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/2-find-next-month-and-previous-month-using-microsoft-flow.jpeg\" alt=\"Find next month and previous month using Microsoft flow\" width=\"1353\" height=\"647\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/2-find-next-month-and-previous-month-using-microsoft-flow.jpeg 1353w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/2-find-next-month-and-previous-month-using-microsoft-flow-300x143.jpeg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/2-find-next-month-and-previous-month-using-microsoft-flow-768x367.jpeg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/2-find-next-month-and-previous-month-using-microsoft-flow-1024x490.jpeg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/2-find-next-month-and-previous-month-using-microsoft-flow-660x316.jpeg 660w\" sizes=\"(max-width: 1353px) 100vw, 1353px\" \/><\/p>\n<p style=\"text-align: justify;\">In Base Time, we set today&#8217;s date, which means from today we are trying to get next month&#8217;s date.<\/p>\n<p style=\"text-align: justify;\">In the Interval field, we set 1, which exactly indicates how many months that we need to add in the current date-time. So 1means we are trying to add one month from today\u2019s date. If we want to find the previous Month&#8217;s date from today then you need to mention -1 in the interval field.<\/p>\n<p style=\"text-align: justify;\">The last field is Time Unit, here we set Time Unit as \u201cMonth\u201d because we need to find out the next month date from today&#8217;s date.<\/p>\n<p style=\"text-align: justify;\">Step 3: From Step 2 we get the next month&#8217;s date which is in UTC format, so we need to convert this UTC date into Central Time date-time using the \u201cConvert Time Zone\u201d action.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-26878 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/3-find-next-month-and-previous-month-using-microsoft-flow.jpeg\" alt=\"Find next month and previous month using Microsoft flow\" width=\"1347\" height=\"649\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/3-find-next-month-and-previous-month-using-microsoft-flow.jpeg 1347w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/3-find-next-month-and-previous-month-using-microsoft-flow-300x145.jpeg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/3-find-next-month-and-previous-month-using-microsoft-flow-768x370.jpeg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/3-find-next-month-and-previous-month-using-microsoft-flow-1024x493.jpeg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/3-find-next-month-and-previous-month-using-microsoft-flow-660x318.jpeg 660w\" sizes=\"(max-width: 1347px) 100vw, 1347px\" \/><\/p>\n<p style=\"text-align: justify;\">Base Time is a Date Time value that we get from Step 3 that we want to convert into Central Time Zone.<\/p>\n<p>Format String indicates on which date-time format we want this date.<br \/>\nSource Time Zone indicates the Time Zone of Date Time value that we want to convert.<br \/>\nDestination Time Zone indicates the output Time Zone<\/p>\n<p>Step 4: Update the calculated output value in the Dynamics CRM field.<\/p>\n<p>For Next Month:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-26879 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/4-find-next-month-and-previous-month-using-microsoft-flow.jpeg\" alt=\"Find next month and previous month using Microsoft flow\" width=\"1343\" height=\"651\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/4-find-next-month-and-previous-month-using-microsoft-flow.jpeg 1343w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/4-find-next-month-and-previous-month-using-microsoft-flow-300x145.jpeg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/4-find-next-month-and-previous-month-using-microsoft-flow-768x372.jpeg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/4-find-next-month-and-previous-month-using-microsoft-flow-1024x496.jpeg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/4-find-next-month-and-previous-month-using-microsoft-flow-660x320.jpeg 660w\" sizes=\"(max-width: 1343px) 100vw, 1343px\" \/><\/p>\n<p>For Previous Month:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-26880 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/5-find-next-month-and-previous-month-using-microsoft-flow.jpeg\" alt=\"Find next month and previous month using Microsoft flow\" width=\"1359\" height=\"649\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/5-find-next-month-and-previous-month-using-microsoft-flow.jpeg 1359w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/5-find-next-month-and-previous-month-using-microsoft-flow-300x143.jpeg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/5-find-next-month-and-previous-month-using-microsoft-flow-768x367.jpeg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/5-find-next-month-and-previous-month-using-microsoft-flow-1024x489.jpeg 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/5-find-next-month-and-previous-month-using-microsoft-flow-660x315.jpeg 660w\" sizes=\"(max-width: 1359px) 100vw, 1359px\" \/><\/p>\n<h2>Conclusion<\/h2>\n<p style=\"text-align: justify;\">We achieved and understood the process for how to calculate next\/previous \u2018X\u2019 months, weeks, days, hours, minutes, and seconds in Power Automate.<\/p>\n<p><a href=\"https:\/\/www.inogic.com\/product\/productivity-apps\/attach-2-dynamics-365-crm-upload-multiple-files-sharepoint-cloud-storage\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-26883 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/attach2dynamics.jpg\" alt=\"attach2dynamics\" width=\"800\" height=\"200\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/attach2dynamics.jpg 800w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/attach2dynamics-300x75.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/attach2dynamics-768x192.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/02\/attach2dynamics-660x165.jpg 660w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction In this blog, we are checking how we can calculate the next\/previous month\u2019s date time from today\u2019s date time or calculate the next\/previous month\u2019s date time from the selected date. There is no direct way or predefined function to calculate the next\/previous month in Power Automate. However, we can achieve this process using the\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2021\/02\/quick-tip-how-to-find-next-month-and-previous-month-using-microsoft-flow-within-dynamics-365-crm\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"categories":[16,19,36,1985],"tags":[545,2007,592,2155,2156,1975],"class_list":["post-26881","post","type-post","status-publish","format-standard","hentry","category-dynamics-365","category-dynamics-crm","category-microsoft-flow","category-power-automate","tag-dynamics-365-crm","tag-dynamics-365-power-automate","tag-dynamics-crm","tag-find-next-month","tag-find-previous-month","tag-power-automate"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/26881","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/users\/13"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/comments?post=26881"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/26881\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=26881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=26881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=26881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}