{"id":23668,"date":"2020-05-26T03:28:20","date_gmt":"2020-05-26T03:28:20","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=23668"},"modified":"2020-05-26T03:28:20","modified_gmt":"2020-05-26T03:28:20","slug":"debug-power-apps-component-for-model-driven-app","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2020\/05\/debug-power-apps-component-for-model-driven-app\/","title":{"rendered":"Debug Power Apps Component for Model Driven App"},"content":{"rendered":"<p style=\"text-align: justify;\">Power Apps Component which was also known as Custom Control is the natural successor to HTML Web resources which was, or still is part of the Dynamics 365 CRM ecosystem for quite a long time.<\/p>\n<p style=\"text-align: justify;\">Developers are quite skilled when it comes to HTML web resources, however, Power Apps Component Framework is pretty simple to pick up, and even for citizen developers it won\u2019t be difficult to get started using Power Apps Component Framework all thanks to the very well written <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/component-framework\/overview\" target=\"_blank\" rel=\"noopener noreferrer\">docs<\/a>.<\/p>\n<p style=\"text-align: justify;\">For those, who have already taken the plunge into Power App Component Framework would understand the time it takes from the building the component to the deployment in CRM (this could vary from few seconds to few minutes). At times, at the time of development you might want to deploy and check whether the piece written is working fine or not, but this might take a bit longer if you are doing this frequently.<\/p>\n<p style=\"text-align: justify;\">Some might debate on why you even want to deploy the code to CRM for debugging, Power Apps Component team has already developed a <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/component-framework\/debugging-custom-controls\" target=\"_blank\" rel=\"noopener noreferrer\">test harness<\/a> for the same. Well, I do not deny the fact that it is really a handy way of testing\/debugging your component but at times your component would deal with various features that could be enabled from <a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/component-framework\/manifest-schema-reference\/\" target=\"_blank\" rel=\"noopener noreferrer\">ControlManifest.Input.xml<\/a> like WebAPI for which you need to deploy the code on CRM before you could actually debug and see if things are working right or not.<\/p>\n<p style=\"text-align: justify;\">This blog will help you cut short the time it takes from building the component to the deployment by allowing you to debug the component without the need to deploy it to your environment with the help of <a href=\"https:\/\/www.telerik.com\/download\/fiddler\" target=\"_blank\" rel=\"noopener noreferrer\">Fiddler<\/a>.<\/p>\n<p>Let us see the step by step process of debugging the component using fiddler:<\/p>\n<p style=\"text-align: justify;\">Step 1: Install <a href=\"https:\/\/www.telerik.com\/download\/fiddler\" target=\"_blank\" rel=\"noopener noreferrer\">Fiddler<\/a> and configure it following these <a href=\"https:\/\/docs.microsoft.com\/en-us\/dynamics365\/customerengagement\/on-premises\/developer\/streamline-javascript-development-fiddler-autoresponder#install-and-configure-fiddler\" target=\"_blank\" rel=\"noopener noreferrer\">steps<\/a><\/p>\n<p>Step 2: Open the page or form where you have configured your component<\/p>\n<p>Step 3: Open the Developer Tools. (Shortcut in Chrome is F12)<\/p>\n<p>Step 4: Go to Sources Tab and from the Navigator locate your CRM URL and within that your Component<\/p>\n<p style=\"padding-left: 40px;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-23669\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/1Debug-Power-Apps-Component-for-Model-Driven-App.png\" alt=\"Debug Power Apps Component for Model Driven App\" width=\"477\" height=\"267\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/1Debug-Power-Apps-Component-for-Model-Driven-App.png 477w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/1Debug-Power-Apps-Component-for-Model-Driven-App-300x168.png 300w\" sizes=\"(max-width: 477px) 100vw, 477px\" \/><\/p>\n<p>Step 5: After locating your Component, Right Click on bundle.js and Copy link address<\/p>\n<p style=\"padding-left: 40px;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-23670\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/2Debug-Power-Apps-Component-for-Model-Driven-App.png\" alt=\"Debug Power Apps Component for Model Driven App\" width=\"351\" height=\"173\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/2Debug-Power-Apps-Component-for-Model-Driven-App.png 351w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/2Debug-Power-Apps-Component-for-Model-Driven-App-300x148.png 300w\" sizes=\"(max-width: 351px) 100vw, 351px\" \/><\/p>\n<p>Step 6: Paste that link in a browser, so that it is easier for you to match it in the AutoResponder of Fiddler<\/p>\n<p>Step 7: Clear the Sessions that are already captured in Fiddler using the Remove All button<\/p>\n<p style=\"padding-left: 40px;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-23671\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/3Debug-Power-Apps-Component-for-Model-Driven-App.png\" alt=\"Debug Power Apps Component for Model Driven App\" width=\"394\" height=\"107\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/3Debug-Power-Apps-Component-for-Model-Driven-App.png 394w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/3Debug-Power-Apps-Component-for-Model-Driven-App-300x81.png 300w\" sizes=\"(max-width: 394px) 100vw, 394px\" \/><\/p>\n<p>Step 8: Hit search\/enter to the link pasted in Step 6, this will be captured in Fiddler<\/p>\n<p>Step 9: Select the captured session and click on AutoResponder<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-23672\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/4Debug-Power-Apps-Component-for-Model-Driven-App.png\" alt=\"Debug Power Apps Component for Model Driven App\" width=\"1128\" height=\"234\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/4Debug-Power-Apps-Component-for-Model-Driven-App.png 1128w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/4Debug-Power-Apps-Component-for-Model-Driven-App-300x62.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/4Debug-Power-Apps-Component-for-Model-Driven-App-768x159.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/4Debug-Power-Apps-Component-for-Model-Driven-App-1024x212.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/4Debug-Power-Apps-Component-for-Model-Driven-App-660x137.png 660w\" sizes=\"(max-width: 1128px) 100vw, 1128px\" \/><\/p>\n<p>Step 10: In the AutoResponder,<\/p>\n<p>Select Enable rules, Accept all CONNECTs and Unmatched requests passthrough<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-23673\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/5Debug-Power-Apps-Component-for-Model-Driven-App.png\" alt=\"Debug Power Apps Component for Model Driven App\" width=\"712\" height=\"263\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/5Debug-Power-Apps-Component-for-Model-Driven-App.png 712w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/5Debug-Power-Apps-Component-for-Model-Driven-App-300x111.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/5Debug-Power-Apps-Component-for-Model-Driven-App-660x244.png 660w\" sizes=\"(max-width: 712px) 100vw, 712px\" \/><\/p>\n<p>Step 11: Add Rule in the AutoResponder, when you click on Add Rule the first text box is filled with your CRM file path. In the second text box, put the path of the file on your local machine<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-23674\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/6Debug-Power-Apps-Component-for-Model-Driven-App.png\" alt=\"Debug Power Apps Component\" width=\"706\" height=\"244\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/6Debug-Power-Apps-Component-for-Model-Driven-App.png 706w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/6Debug-Power-Apps-Component-for-Model-Driven-App-300x104.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/6Debug-Power-Apps-Component-for-Model-Driven-App-660x228.png 660w\" sizes=\"(max-width: 706px) 100vw, 706px\" \/><\/p>\n<p>Step 12: Hit Test to see if the pattern matches the test or not<\/p>\n<p><img decoding=\"async\" class=\"wp-image-23675 aligncenter\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/7Debug-Power-Apps-Component-for-Model-Driven-App.png\" alt=\"Debug Power Apps Component for Model Driven App\" width=\"788\" height=\"327\" \/><\/p>\n<p>Step 13: Next I will make some changes in the Component file and build it and thereafter will refresh the page to see the file being pulled from local machine and not from CRM.<\/p>\n<p><strong><em>Note: <\/em><\/strong><em>If normal refresh does not work for you, try Empty Cache and Hard Reload.<\/em><\/p>\n<p>Step 14: After Empty Cache and Hard Reload (I prefer doing this), I could see the file being pulled from my local machine.<\/p>\n<p style=\"padding-left: 40px;\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-23676\" style=\"border: 1px solid #0a0a0a; padding: 1px; margin: 1px;\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/8Debug-Power-Apps-Component-for-Model-Driven-App.png\" alt=\"Debug Power Apps Component for Model Driven App\" width=\"465\" height=\"101\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/8Debug-Power-Apps-Component-for-Model-Driven-App.png 465w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2020\/05\/8Debug-Power-Apps-Component-for-Model-Driven-App-300x65.png 300w\" sizes=\"(max-width: 465px) 100vw, 465px\" \/><\/p>\n<h2>Conclusion<\/h2>\n<p>Now, debugging your piece of logic in the component will not take much time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Power Apps Component which was also known as Custom Control is the natural successor to HTML Web resources which was, or still is part of the Dynamics 365 CRM ecosystem for quite a long time. Developers are quite skilled when it comes to HTML web resources, however, Power Apps Component Framework is pretty simple to\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2020\/05\/debug-power-apps-component-for-model-driven-app\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":13,"featured_media":23677,"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":[18,38,44],"tags":[1194,1337],"class_list":["post-23668","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dynamics-365-v9-2","category-microsoft-powerapps","category-power-apps","tag-model-driven-app","tag-power-apps"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/23668","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=23668"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/23668\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media\/23677"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=23668"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=23668"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=23668"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}