{"id":29195,"date":"2021-08-26T11:46:48","date_gmt":"2021-08-26T11:46:48","guid":{"rendered":"https:\/\/www.inogic.com\/blog\/?p=29195"},"modified":"2021-08-30T10:58:22","modified_gmt":"2021-08-30T10:58:22","slug":"how-to-use-a-custom-api-as-a-step-in-dynamics-365-crm-workflows","status":"publish","type":"post","link":"https:\/\/www.inogic.com\/blog\/2021\/08\/how-to-use-a-custom-api-as-a-step-in-dynamics-365-crm-workflows\/","title":{"rendered":"How to use a custom API as a step in Dynamics 365 CRM Workflows"},"content":{"rendered":"<h2 style=\"text-align: justify;\"><strong>Introduction:<\/strong><\/h2>\n<p style=\"text-align: justify;\">Microsoft recently introduced us to the Custom API feature which is a new way of creating custom actions in Dynamics 365 CRM as seen in our previous <a href=\"https:\/\/www.inogic.com\/blog\/2021\/03\/introducing-custom-api-the-new-way-of-creating-custom-actions-in-dataverse\/\" target=\"_blank\" rel=\"noopener noreferrer\">blog<\/a>. However, while writing the previous blog, there wasn\u2019t any way of using this custom API in workflows.<\/p>\n<p style=\"text-align: justify;\">But recently, we did see an approach to make use of the custom API with workflows.<\/p>\n<p style=\"text-align: justify;\">Now let\u2019s see how to achieve this.<\/p>\n<p style=\"text-align: justify;\">For demonstration purpose, we are creating a custom API that will be used in a workflow which will be triggered on creation of an account record. And every time this workflow gets triggered, it\u2019ll call the custom API created by us, which will create a Phone Call activity associated to the same account with the due date set as the next day.<\/p>\n<p style=\"text-align: justify;\"><strong>Step 1: Go to your solution in the power platform, click on \u2018New\u2019 and select the Custom API.<\/strong><\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image001-ink-21.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-29196 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image001-ink-21.png\" alt=\"How to use a custom API as a step in Dynamics 365 CRM Workflows\" width=\"1134\" height=\"632\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image001-ink-21.png 1134w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image001-ink-21-300x167.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image001-ink-21-768x428.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image001-ink-21-1024x571.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image001-ink-21-660x368.png 660w\" sizes=\"(max-width: 1134px) 100vw, 1134px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><strong>Step 2: A system form for Custom API will open up. Fill up the information about custom API.<\/strong><\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image003-ink-18.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-29197 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image003-ink-18.png\" alt=\"How to use a custom API as a step in Dynamics 365 CRM Workflows\" width=\"860\" height=\"829\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image003-ink-18.png 860w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image003-ink-18-300x289.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image003-ink-18-768x740.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image003-ink-18-660x636.png 660w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><strong>Unique Name:<\/strong> Unique name for the Custom API. This will be shown in the Perform Action step in the workflow, so keep it easily identifiable.<\/p>\n<p style=\"text-align: justify;\"><strong>Binding Type: <\/strong>Binding Type is an option set field and could be set as Global, Entity, and Entity Collection. Here, we have set it to Entity, because we need to bind this API to the account entity.<\/p>\n<p style=\"text-align: justify;\"><strong>Bound Entity Logical Name<\/strong><strong>:<\/strong>\u00a0Here we need to put the logical name of the entity if we set Binding type as Entity.<\/p>\n<p style=\"text-align: justify;\"><strong>Note:-<\/strong><em>Since we want to retrieve the account record in context of which the workflow was fired, we are setting Binding type to Entity &amp; Bound Entity logical Name to account so that we will be able to pass that as the target to our plugin called in the custom API.<\/em><\/p>\n<p style=\"text-align: justify;\"><strong>Enabled for Workflow:<\/strong> It is a Boolean type field, in which we set if we want to allow this custom API to be used in workflow steps or not. <em>We are setting it to true since we want to use it in the workflow step.<\/em><\/p>\n<p style=\"text-align: justify;\"><strong>Note:- <\/strong><em>This is the important field which plays the key role in making use of the custom API with workflows, which was not made available earlier but now it can very much be seen on the custom API form.<\/em><\/p>\n<p style=\"text-align: justify;\"><em>\u00a0<\/em><strong>Plugin Type: <\/strong>As explained in our previous blog as well, this is the lookup type of field which shall hold the already registered Plug-in assembly that is responsible for creation of phone call activity. Thus, it is advisable to first write and register your plug-in in CRM before starting with the custom API. If you are new to Plug-ins, then you can follow the steps\u00a0<a href=\"https:\/\/docs.microsoft.com\/en-us\/powerapps\/developer\/data-platform\/tutorial-write-plug-in\" target=\"_blank\" rel=\"noopener noreferrer\">from here<\/a>.<\/p>\n<p style=\"text-align: justify;\">From the next steps, we shall see how to use the custom API created in the above steps in workflow.<\/p>\n<p style=\"text-align: justify;\"><strong>Step 3: Navigate to Advanced Settings -&gt; Processes -&gt; Create on New.<\/strong><\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image005-ink-15.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-29198 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image005-ink-15.png\" alt=\"How to use a custom API as a step in Dynamics 365 CRM Workflows\" width=\"280\" height=\"279\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image005-ink-15.png 280w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image005-ink-15-150x150.png 150w\" sizes=\"(max-width: 280px) 100vw, 280px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image009-ink-9.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-29199 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image009-ink-9.png\" alt=\"How to use a custom API as a step in Dynamics 365 CRM Workflows\" width=\"1064\" height=\"43\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image009-ink-9.png 1064w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image009-ink-9-300x12.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image009-ink-9-768x31.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image009-ink-9-1024x41.png 1024w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image009-ink-9-660x27.png 660w\" sizes=\"(max-width: 1064px) 100vw, 1064px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image007-ink-11.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-29201 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image007-ink-11.png\" alt=\"How to use a custom API as a step in Dynamics 365 CRM Workflows\" width=\"205\" height=\"276\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><strong>Step 4: After filling up the information in the dialog box, click on Ok.<\/strong><\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image011-ink-7.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-29200 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image011-ink-7.png\" alt=\"How to use a custom API as a step in Dynamics 365 CRM Workflows\" width=\"647\" height=\"486\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image011-ink-7.png 647w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image011-ink-7-300x225.png 300w\" sizes=\"(max-width: 647px) 100vw, 647px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><strong>Step 5: Click on Add Step -&gt; Select Perform Action.<\/strong><\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image013-ink-5.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-29202 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image013-ink-5.png\" alt=\"How to use a custom API as a step in Dynamics 365 CRM Workflows\" width=\"300\" height=\"308\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image013-ink-5.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image013-ink-5-292x300.png 292w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><strong>Step 6: Select the custom API that we have created before. Note that the Entity will be automatically selected as Accounts. Click on Set Properties.<\/strong><\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image015-ink-3.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-29203 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image015-ink-3.png\" alt=\"How to use a custom API as a step in Dynamics 365 CRM Workflows\" width=\"567\" height=\"72\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image015-ink-3.png 567w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image015-ink-3-300x38.png 300w\" sizes=\"(max-width: 567px) 100vw, 567px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><strong>Step 7: Select Account -&gt; Account in \u2018Look for\u2019 and click on Add and then on Ok. It should look similar to this.<\/strong><\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image017-ink-7.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"aligncenter wp-image-29204 size-full\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image017-ink-7.png\" alt=\"How to use a custom API as a step in Dynamics 365 CRM Workflows\" width=\"845\" height=\"471\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image017-ink-7.png 845w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image017-ink-7-300x167.png 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image017-ink-7-768x428.png 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/image017-ink-7-660x368.png 660w\" sizes=\"(max-width: 845px) 100vw, 845px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><strong>Step 8: Activate the process.<\/strong><\/p>\n<p style=\"text-align: justify;\"><strong>Step 9: Create an Account record. And a phone call activity record will get created associated to the account with the due date as the next day and thus can be seen in the Timeline as well.<\/strong><\/p>\n<p style=\"text-align: justify;\"><strong>Conclusion: <\/strong>This is how we can use the Enabled for Workflow feature of custom API to use custom API in a workflow step.<\/p>\n<p style=\"text-align: justify;\"><a href=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/mmr.jpg\"><img decoding=\"async\" class=\"size-full wp-image-28887\" src=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/mmr.jpg\" alt=\"Map My Relationships\" width=\"800\" height=\"200\" srcset=\"https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/mmr.jpg 800w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/mmr-300x75.jpg 300w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/mmr-768x192.jpg 768w, https:\/\/www.inogic.com\/blog\/wp-content\/uploads\/2021\/08\/mmr-660x165.jpg 660w\" sizes=\"(max-width: 800px) 100vw, 800px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: Microsoft recently introduced us to the Custom API feature which is a new way of creating custom actions in Dynamics 365 CRM as seen in our previous blog. However, while writing the previous blog, there wasn\u2019t any way of using this custom API in workflows. But recently, we did see an approach to make\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.inogic.com\/blog\/2021\/08\/how-to-use-a-custom-api-as-a-step-in-dynamics-365-crm-workflows\/\">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":[2361,67],"tags":[2367,2368],"class_list":["post-29195","post","type-post","status-publish","format-standard","hentry","category-technical","category-workflows","tag-custom-api-dynamics-365","tag-dynamics-365-crm-workflows"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/29195","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=29195"}],"version-history":[{"count":0,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/posts\/29195\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/media?parent=29195"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/categories?post=29195"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inogic.com\/blog\/wp-json\/wp\/v2\/tags?post=29195"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}