{"id":14393,"date":"2020-07-03T06:48:58","date_gmt":"2020-07-03T04:48:58","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/"},"modified":"2024-09-11T15:07:52","modified_gmt":"2024-09-11T13:07:52","slug":"microsoft-teams-power-automate-and-planner","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/","title":{"rendered":"Microsoft Teams, Power Automate and Planner"},"content":{"rendered":"<p>As we moved to Teams at dbi and one of our customers, automating tasks was a strong need.<br \/>\nOne of the tasks that could be automated is the creation of tasks in Microsoft Planner which does not support recurring tasks. Every 4 weeks, we are patching the environment. For everyone awareness and follow up, we need to publish these dates in the planning. As the pace of these tasks is known, it is a bit repetitive to create these tasks manually.<br \/>\n<!--more--><br \/>\nMicrosoft Power Automate (previously known as Flow) is powerful tool to automate tasks and it integrate natively with Teams. My idea was to create 4 tasks just by providing the first date and then creating all of them on a 7 days interval.<\/p>\n<h3>Flows Overview<\/h3>\n<ol style=\"list-style-type: lower-alpha\">\n<li>Initialize <strong>indice<\/strong> to 1. We will use it to iterate<\/li>\n<li>Initialize a <strong>First Day of Cycle<\/strong> object based on user input<\/li>\n<li>Initialize an <strong>ArrayOfEnv<\/strong> which will be used for naming each task. For example, array can contain:\n<ol>\n<li>Sandbox<\/li>\n<li>Dev<\/li>\n<li>Test<\/li>\n<li>Prod<\/li>\n<\/ol>\n<\/li>\n<li>Then create a loop and iterate until we reach 4\n<ol>\n<li>Creation of the task with\n<ul>\n<li>Title based on <strong>ArrayOfEnv<\/strong>[<strong>indice<\/strong>] content<\/li>\n<li>Date based on selected <strong>First Day of Cycle<\/strong> + 7 x <strong>indice<\/strong><\/li>\n<\/ul>\n<\/li>\n<li>Increment <strong>indice<\/strong><\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<p>That\u2019s it! very basic, but can save time.<\/p>\n<h3>Formulas<\/h3>\n<p>One of the main difficulties was to find documentation on formulas that work.<br \/>\nFor example, the date selected will be formatted with a specific format, but <em>AddDays<\/em> function do not support it well if you don\u2019t provide expected output format. Solution is to force formatting of the date selected and have it the same across whole flow.<\/p>\n<p>Main functions used for this flow:<\/p>\n<ul>\n<li>To get value of a variable, I used <em>variables<\/em> function with variable name as parameter.<\/li>\n<li><em>Add<\/em> to obviously sum up all parameters provided.<\/li>\n<li><em>Mul<\/em> to multiply.<\/li>\n<li>Creation of an array with <em>createArray<\/em> and the name I would like for each task:<br \/>\n<code>createArray('Sandbox','Dev','Test','Prod') <\/code><\/li>\n<\/ul>\n<h3>Flows Details<\/h3>\n<p>First part of it is the manual trigger with date as input:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/1-Manually-trigger-a-flow-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-41414\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/1-Manually-trigger-a-flow-1.png\" alt=\"\" width=\"500\" height=\"172\" \/><\/a><\/p>\n<p>Second part is initialization of variables:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/2-Set-Variables-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-41417\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/2-Set-Variables-1.png\" alt=\"\" width=\"638\" height=\"650\" \/><\/a><\/p>\n<p>Finally, the loop:<br \/>\n<a href=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/3-loop-obs-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-41420\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/3-loop-obs-2.png\" alt=\"\" width=\"545\" height=\"693\" \/><\/a><\/p>\n<p>Formulas:<\/p>\n<ul>\n<li>Title:<br \/>\n<code>concat(variables('ArrayOfEnv')[variables('Indice')],' ',' Patching')<\/code><\/li>\n<li>Start and end date Time:<br \/>\n<code>addDays(variables('SelectedDate'),mul(variables('indice'),7),'yyyy-MM-dd')<\/code><\/li>\n<\/ul>\n<h3>Next Steps<\/h3>\n<p>For now, it is only a manual trigger of the flow. Next step would be to schedule that at each cycle beginning.<\/p>\n<p>Power Automate looks like a promising tool, but Microsoft must work more on it to be able to have a full text mode as mix of click and formulas makes it impossible to export.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As we moved to Teams at dbi and one of our customers, automating tasks was a strong need. One of the tasks that could be automated is the creation of tasks in Microsoft Planner which does not support recurring tasks. Every 4 weeks, we are patching the environment. For everyone awareness and follow up, we [&hellip;]<\/p>\n","protected":false},"author":26,"featured_media":14394,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[229],"tags":[49,2019,2020],"type_dbi":[],"class_list":["post-14393","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-database-administration-monitoring","tag-microsoft","tag-power-automate","tag-teams"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.2 (Yoast SEO v27.2) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Microsoft Teams, Power Automate and Planner - dbi Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Microsoft Teams, Power Automate and Planner\" \/>\n<meta property=\"og:description\" content=\"As we moved to Teams at dbi and one of our customers, automating tasks was a strong need. One of the tasks that could be automated is the creation of tasks in Microsoft Planner which does not support recurring tasks. Every 4 weeks, we are patching the environment. For everyone awareness and follow up, we [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi Blog\" \/>\n<meta property=\"article:published_time\" content=\"2020-07-03T04:48:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-11T13:07:52+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/1-Manually-trigger-a-flow-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"637\" \/>\n\t<meta property=\"og:image:height\" content=\"219\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Microsoft Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Microsoft Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/\"},\"author\":{\"name\":\"Microsoft Team\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\"},\"headline\":\"Microsoft Teams, Power Automate and Planner\",\"datePublished\":\"2020-07-03T04:48:58+00:00\",\"dateModified\":\"2024-09-11T13:07:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/\"},\"wordCount\":404,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/1-Manually-trigger-a-flow-1.png\",\"keywords\":[\"Microsoft\",\"Power Automate\",\"Teams\"],\"articleSection\":[\"Database Administration &amp; Monitoring\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/\",\"name\":\"Microsoft Teams, Power Automate and Planner - dbi Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/1-Manually-trigger-a-flow-1.png\",\"datePublished\":\"2020-07-03T04:48:58+00:00\",\"dateModified\":\"2024-09-11T13:07:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/#primaryimage\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/1-Manually-trigger-a-flow-1.png\",\"contentUrl\":\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/1-Manually-trigger-a-flow-1.png\",\"width\":637,\"height\":219},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\/\/www.dbi-services.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Microsoft Teams, Power Automate and Planner\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#website\",\"url\":\"https:\/\/www.dbi-services.com\/blog\/\",\"name\":\"dbi Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4\",\"name\":\"Microsoft Team\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g\",\"caption\":\"Microsoft Team\"},\"url\":\"https:\/\/www.dbi-services.com\/blog\/author\/microsoft-team\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Microsoft Teams, Power Automate and Planner - dbi Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/","og_locale":"en_US","og_type":"article","og_title":"Microsoft Teams, Power Automate and Planner","og_description":"As we moved to Teams at dbi and one of our customers, automating tasks was a strong need. One of the tasks that could be automated is the creation of tasks in Microsoft Planner which does not support recurring tasks. Every 4 weeks, we are patching the environment. For everyone awareness and follow up, we [&hellip;]","og_url":"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/","og_site_name":"dbi Blog","article_published_time":"2020-07-03T04:48:58+00:00","article_modified_time":"2024-09-11T13:07:52+00:00","og_image":[{"width":637,"height":219,"url":"http:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/1-Manually-trigger-a-flow-1.png","type":"image\/png"}],"author":"Microsoft Team","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Microsoft Team","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/"},"author":{"name":"Microsoft Team","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"headline":"Microsoft Teams, Power Automate and Planner","datePublished":"2020-07-03T04:48:58+00:00","dateModified":"2024-09-11T13:07:52+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/"},"wordCount":404,"commentCount":0,"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/1-Manually-trigger-a-flow-1.png","keywords":["Microsoft","Power Automate","Teams"],"articleSection":["Database Administration &amp; Monitoring"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/","url":"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/","name":"Microsoft Teams, Power Automate and Planner - dbi Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/1-Manually-trigger-a-flow-1.png","datePublished":"2020-07-03T04:48:58+00:00","dateModified":"2024-09-11T13:07:52+00:00","author":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4"},"breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/1-Manually-trigger-a-flow-1.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/sites\/2\/2022\/04\/1-Manually-trigger-a-flow-1.png","width":637,"height":219},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/microsoft-teams-power-automate-and-planner\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Microsoft Teams, Power Automate and Planner"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/bfab48333280d616e1170e7369df90a4","name":"Microsoft Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c44a1a792c059f24055763aa77d80a244467f6eef724a8bd13db8d4a350b7a4c?s=96&d=mm&r=g","caption":"Microsoft Team"},"url":"https:\/\/www.dbi-services.com\/blog\/author\/microsoft-team\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/14393","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/26"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=14393"}],"version-history":[{"count":1,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/14393\/revisions"}],"predecessor-version":[{"id":34731,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/14393\/revisions\/34731"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media\/14394"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=14393"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=14393"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=14393"},{"taxonomy":"type","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/type_dbi?post=14393"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}