Call Custom API in Classic Workflow: Dataverse Guide
Image Source:
Microsoft Dataverse
Jan 7, 2024 3:00 AM

Call Custom API in Classic Workflow: Dataverse Guide

by HubSite 365 about Temmy Wahyu Raharjo
External Blog Post
Citizen Developer

Microsoft DataversePower AutomateLearning Selection

Unleash Dataverse Potential: Integrating Custom API with Classic Workflows!

Key insights


Integrating Dataverse with Power Platform: This blog post by Temmy Wahyu Raharjo outlines the process of integrating Dataverse (Dynamics CRM) with Power Platform to achieve various integration scenarios. Specifically, it delves into using Dataverse solely for generic integration.

Custom API Creation: The author explains how to create a Custom API to record history changes in an Excel online, working dynamically with the Contact table, and allowing a Business Analyst to configure the workflow later. This utilizes Custom API, Classic Workflows, and Power Automate for integration.

Preparing Integration API: Temmy shares steps to prepare an Excel table in Sharepoint and construct a flow for a JSON Body with the structure featuring 'entity', 'id', 'name', etc. Storing the flow's URL in an Environment Variable for use in Classic Workflow is advised for convenience.

Custom API Code Explanation: The API requires three parameters: EntityName, EntityId, and Message. It retrieves Integration URLs, Entity Metadata for primary attributes, and user information – and uses the RestSharp library for HTTP requests.

Deploying and Utilizing the Custom API: After setting up the Custom API – ensuring it is enabled for workflows – the process for including it in a Classic Workflow is demonstrated. This involves dealing with the EntityId issue and configuring workflow parameters for Create, Update, or Delete actions.

  • Understand the integration of Dataverse with Power Platform for scenario-specific applications.
  • Recognize the process of creating a Custom API and its practical utility in recording data changes to Excel online.
  • Learn the setup for an Integration API using Power Automate and the significance of storing URLs in Environment Variables.
  • Comprehend how to code the Custom API, focusing on parameter requirements and data retrieval methodologies.
  • Gain insights into deploying the Custom API in Classic Workflows within Dynamics 365 and handling potential challenges.

Dynamics 365 and Power Platform Integration

The seamless integration of Dynamics 365’s Dataverse with Power Platform is a testament to the versatility of Microsoft's business application suite. By creating Custom APIs, professionals like Temmy Wahyu Raharjo and others exemplify the innovative ways to leverage these platforms for enhanced data management and process automation. Establishing links between Dataverse and an Excel online record history, through meticulous creation and implementation of a Custom API, presents opportunities for businesses to streamline workflows and enhance data tracking. The technical guidance provided offers a practical glimpse into modernizing business processes, demonstrating the robustness of Dynamics 365’s integration capabilities with Power Platform tools. This type of integration showcases how organizations can harness data more strategically, ultimately refining the dynamics of customer relationship management and operational workflows.




Read the full article Dataverse: How to call Custom API in classic Workflow


Dataverse is a flexible, cloud-based platform that has revolutionized customer relationship management (CRM) and enterprise resource planning (ERP) for many organizations. When designing solutions within the Microsoft Power Platform, there are numerous strategies one can follow. In particular, merging Microsoft Dataverse with the Power Platform facilitates a wide array of integration scenarios and custom workflows.

However, the focus of today’s discussion lies in using only Microsoft Dataverse to implement generic integrations. This blog from Temmy Wahyu Raharjo illustrates the details of calling a Custom API in a classic workflow on the platform. The effectiveness of using this method is underscored, especially when it involves writing record history changes into an Excel Online document, using only the Contact table for now.

To enable this, Temmy explains the necessity of creating a Custom API that later allows a Business Analyst to configure the workflow. The components employed in this endeavor include Custom API, Classic Workflows, and Power Automate for integration. This approach bypasses the need for developing an API from scratch, which can be advantageous for efficiency.

Moving on to the technical side, Temmy outlines the steps for preparing the integration through Power Automate. An Excel table is first setup on a Sharepoint site, followed by constructing a specific JSON structure for data handling. The flow requires storing the integration URL in an Environment Variable for enhanced sophistication in process management.

Temmy shares the finished code for the Custom API, detailing the necessary string parameters: EntityName, EntityId, and Message. The logic flows as follows: integration URL is fetched from an Environment Variable, entity metadata is retrieved except in deletion scenarios, and then a HTTP POST request is made with a JSON object. A seamless implementation makes use of the RestSharp NuGet package for calling the integration API.

After setting up the API, the next step involves enabling it within Classic Workflow configurations. In particular, "Enabled For Workflow" must be set to true to allow its usage in Classic Workflow actions. Once parameters are in place, the final process details creating a Classic Workflow for the desired actions, and setting parameters appropriately before activation.

Despite some challenges within the Classic Workflow, such as a potential product defect in handling GUID parameters, alternative methods are suggested. Temmy demonstrates using Formula Columns to supply the EntityId, and then integrating it in the workflow through action steps. The procedure concludes with parameter adjustments and workflow activation, leading up to successful testing.

Temmy concludes with a cheerful note encouraging CRM enthusiasts to engage with the solution and explore the capabilities of Microsoft Dataverse in their workflow scenarios. The post emphasizes continual learning and embraces the power of technology to enhance CRM practices.

What is Microsoft Dataverse

Microsoft Dataverse is an essential tool that simplifies data management across business applications. It acts as a scalable data service and app platform, integrating seamlessly into the Power Platform including Dynamics 365, Microsoft 365, Teams, and Power Apps. Dataverse facilitates data storage, management, and security, while enabling creators to develop rich, interactive business applications even without extensive technical expertise.

With its robust set of tools, Dataverse empowers businesses to create and automate workflows, analyze data across different systems, and improve overall operational efficiency. The platform supports a data-first approach and allows for logical and physical data models to coexist, making it easier for users to model complex relationships and business processes. Additionally, it encourages a more comprehensive understanding of data through AI-driven insights.

Moreover, Dataverse's integration capabilities, as explored in Raharjo's blog, showcase the versatility and power of the platform in architecting solutions that meet unique business needs. Its compatibility with various APIs and services enables a broad spectrum of possibilities, from simple data entries to complex integrations. Whether for a novice or an expert, Microsoft Dataverse is a transformative tool that can dramatically enhance efficiency and innovation in any business environment.


What is Microsoft Dataverse Custom API Integration with Classic Workflows

Diving into solutions within the Power Platform, there are various approaches one can take. The ability to combine Microsoft Dataverse with other Power Platform tools allows for diverse integration scenarios. However, there may be times when utilizing only Microsoft Dataverse for generic integration is the objective.

In a recent blog post, the focus is on how to implement a system to log record history changes to Excel online. This involves working specifically with the 'Contact' table within Microsoft Dataverse. The solution requires the creation of a Custom API and configuration of workflows by a Business Analyst.

Components such as Custom API, Classic Workflows, and Power Automate's integration API are essential in this process. This combination helps to avoid the need for building APIs from scratch. Detailed steps involving preparation and creation of necessary elements are provided to guide users through the process.

The process involves setting up an Excel table on SharePoint and creating a flow in Power Automate. The structure for the JSON body used in the flow is detailed, and its significance explained. The use of Environment Variables to store the API URL is introduced, adding efficiency to the workflow.

A code snippet reveals the Custom API's core where the main functionality resides. It describes the API's need for three string parameters: EntityName, EntityId, and Message. With the aid of Dataverse services and methods, the API performs the necessary operations to log data changes.

The Custom API should be deployed and configured correctly to be utilized in Classic Workflows. Crucial settings include enabling the API for workflow usage. Moreover, the blog highlights a challenge encountered with EntityId in Workflow actions and provides an inventive solution.

Finally, the implementation of the Custom API in Classic Workflows is illustrated. Steps involve creating Classic Workflow, adding the necessary actions, and setting parameters. Once activated, this allows for seamless tracking of changes on selected entities within Microsoft Dataverse.

The blog post concludes with the author's insights and experience from their implementation. As a Microsoft Dynamics 365 Technical Consultant, the author shares expertise and encourages ongoing learning and efficient coding practices within the CRM community.

Enhancing Data Management in Microsoft Dataverse

In the modern technology landscape, data management and integration are key aspects of business operations. Microsoft Dataverse serves as a robust data platform that enables developers and analysts alike to streamline workflows and enhance data integration, providing a structured approach to store and manage data used in business applications.

Implementing Custom APIs allows users to tailor their data management needs, particularly when integrated with other automation and customization tools like Classic Workflows and Power Automate. This enables businesses to optimize data tracking, modification, and reporting within their operations.

The Dataverse framework aligns with the concept of a low-code, no-code environment, placing powerful data handling capabilities in the hands of users who may not have a deep technical background. Dataverse's versatility and integration capacity prove invaluable for creating comprehensive and efficient systems that leverage data in meaningful, impactful ways.


Microsoft Dataverse - Call Custom API in Classic Workflow: Dataverse Guide



People also ask

What is the difference between custom API and custom action in Dataverse?

Custom API and custom actions in Dataverse serve as mechanisms to extend business logic beyond the out-of-the-box capabilities provided. However, they differ primarily in their implementation and customization flexibility. Custom APIs offer a more granular control and are considered the next generation of custom actions, providing better capabilities like defining request and response property types, making them a preferred choice for complex operations.

How do I call a custom API in Power Automate?

Calling a custom API in Power Automate usually involves creating an HTTP request within a flow to the appropriate endpoint configured in Dataverse. The custom API’s URL, required headers, and parameters should be specified in the Power Automate action. Authentication details such as an API key or OAuth token may need to be appended according to the API’s security requirements.

How do I use custom API in PowerApps?

Utilizing a custom API in PowerApps typically involves adding a custom connector that is configured to interact with the Dataverse custom API. Once the connector is set up, app makers can use it much like any other data source or service, implementing actions and processing responses within the PowerApps environment.

What is Dataverse custom API?

Dataverse custom API is a feature that allows developers to create new APIs to perform operations that aren't possible with existing Dataverse capabilities. These APIs are purpose-built for unique business processes, offering endpoints for specialized operations that can be called from various Microsoft Power Platform components including PowerApps, Power Automate, and more. Custom APIs in Dataverse are tightly integrated with the platform's permission model, ensuring secure access control for the operations they perform.



Dataverse Custom API, Classic Workflow Integration, Call Custom API, Dataverse Workflow, Custom API Workflow, Use API in Dataverse, Workflow Custom Action, Dataverse API Methods, Implement Custom API Workflow, Dataverse Custom Function