{"id":20926,"date":"2019-10-28T11:56:11","date_gmt":"2019-10-28T11:56:11","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=20926"},"modified":"2022-07-19T16:43:44","modified_gmt":"2022-07-19T11:13:44","slug":"how-to-run-microsoft-flow-through-custom-ribbon-button-using-http-request","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2019\/10\/how-to-run-microsoft-flow-through-custom-ribbon-button-using-http-request\/","title":{"rendered":"How to run Microsoft Flow through Custom Ribbon Button using http request"},"content":{"rendered":"<p>Introduction:<\/p>\n<p>Microsoft Flow is a Microsoft service which works as middle ware in different platforms and allows to perform many operations in Dynamics 365 CRM that is similar to workflows.<\/p>\n<p>In this blog, we will see how we can run the Microsoft Flow directly from the custom button of Dynamics 365 CRM.<\/p>\n<p>For example, we have a requirement to run the Microsoft Flow in custom button directly or after doing any operations.<\/p>\n<p>In order to achieve this, follow the steps given below:<\/p>\n<p>Step 1: &#8211; Create Microsoft instant Flow and select \u2018When an http request is received\u2019.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-20927\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_1.png\" alt=\"\" width=\"1182\" height=\"630\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_1.png 1182w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_1-300x160.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_1-768x409.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_1-1024x546.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_1-660x352.png 660w\" sizes=\"(max-width: 1182px) 100vw, 1182px\" \/><\/p>\n<p>Step 2: &#8211; After creating the Flow, set a unique name for the current Flow. Next, add JSON schema as per the data you want to receive or generate by clicking on <strong>use sample payload to generate schema<\/strong>.<br \/>\nIn this blog, we will be passing JSON object to the request as given below:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-20928\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_2.png\" alt=\"\" width=\"930\" height=\"508\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_2.png 930w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_2-300x164.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_2-768x420.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_2-660x361.png 660w\" sizes=\"(max-width: 930px) 100vw, 930px\" \/><\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-20929\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_3.png\" alt=\"\" width=\"887\" height=\"420\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_3.png 887w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_3-300x142.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_3-768x364.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_3-660x313.png 660w\" sizes=\"(max-width: 887px) 100vw, 887px\" \/><\/p>\n<p>Step 3: &#8211; Add composer to store data that has passed to the request from Dynamics 365 CRM.<img decoding=\"async\" class=\"aligncenter size-full wp-image-20930\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_4.png\" alt=\"\" width=\"653\" height=\"166\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_4.png 653w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_4-300x76.png 300w\" sizes=\"(max-width: 653px) 100vw, 653px\" \/><\/p>\n<p>Now save the Flow and copy URL of http request which is going to be used in script on custom ribbon button.<img decoding=\"async\" class=\"aligncenter size-full wp-image-20931\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_5.png\" alt=\"\" width=\"616\" height=\"130\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_5.png 616w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_5-300x63.png 300w\" sizes=\"(max-width: 616px) 100vw, 616px\" \/><\/p>\n<p>Step 4: &#8211; Create a script file and add the JavaScript function for custom button.<\/p>\n<p>Step 5:- On click of button, script function will be called and http request will be executed. To run Microsoft Flow the process is as follows:<\/p>\n<ol>\n<li>Create a JSON object as data and make sure to provide the same property as we have in Microsoft Flow.<\/li>\n<li>Set the http request URL which we have copied in step 3 from Flow.<\/li>\n<li>And once we get the success status from the request we will be showing a popup message or you can have your own logic as per your requirement.<\/li>\n<\/ol>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-20932\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_6.png\" alt=\"\" width=\"1020\" height=\"523\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_6.png 1020w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_6-300x154.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_6-768x394.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_6-660x338.png 660w\" sizes=\"(max-width: 1020px) 100vw, 1020px\" \/><\/p>\n<p style=\"text-align: justify;\">Step 6: &#8211; Add custom button on the entity on which you want to run the Flow. We have added a custom button on account entity by using ribbon workbench and on click event we have selected the script and script function created in steps 4 &amp; 5 as shown in the following screenshot:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-20933\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_7.png\" alt=\"\" width=\"1331\" height=\"360\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_7.png 1331w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_7-300x81.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_7-768x208.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_7-1024x277.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_7-660x179.png 660w\" sizes=\"(max-width: 1331px) 100vw, 1331px\" \/><\/p>\n<p>Step 7: &#8211; Now go to the entity and click on the custom button. Here is our Flow which ran successfully.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-20934\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_8.png\" alt=\"\" width=\"1002\" height=\"579\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_8.png 1002w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_8-300x173.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_8-768x444.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2019\/10\/http_8-660x381.png 660w\" sizes=\"(max-width: 1002px) 100vw, 1002px\" \/><\/p>\n<p>Conclusion:<\/p>\n<p>Thus, with <strong>\u2018When http request receive\u2019<\/strong> connector we can run Microsoft Flow by executing the http request from custom ribbon button.<\/p>\n<h2 style=\"text-align: left;\"><div class=\"su-heading su-heading-style-default su-heading-align-center\" id=\"\" style=\"font-size:15px;margin-bottom:5px\"><div class=\"su-heading-inner\">70% of global 2000 companies apply gamification to improve productivity and returns!<\/div><\/div><\/h2>\n<p><em><strong><a href=\"https:\/\/bit.ly\/3RD4lYW\" target=\"_blank\" rel=\"noopener noreferrer\">Gamifics365<\/a> <\/strong>\u2013 Spin the magic of games within Microsoft Dynamics 365 CRM to improve user adoption, enhance productivity, and achieve company goals!<\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: Microsoft Flow is a Microsoft service which works as middle ware in different platforms and allows to perform many operations in Dynamics 365 CRM that is similar to workflows. In this blog, we will see how we can run the Microsoft Flow directly from the custom button of Dynamics 365 CRM. For example, we\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2019\/10\/how-to-run-microsoft-flow-through-custom-ribbon-button-using-http-request\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":20935,"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":[36,1985],"tags":[],"class_list":["post-20926","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-microsoft-flow","category-power-automate"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/20926","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=20926"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/20926\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/20935"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=20926"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=20926"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=20926"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}