Power Plattform Archives -

Category Archives: Power Plattform

Connecting Your MCP Server to Microsoft Copilot Studio – Part 2

In Part 1, we built a simple MCP server in TypeScript that exposed a “getWeather” tool. Now, let’s take the next step: connecting our MCP server to Microsoft Copilot Studio so that Copilot agents can call it directly. This section will cover: Step 1 — Publish Your MCP Server to Azure To make your MCP server accessible to Copilot Studio, you’ll need to host it online. There are multiple ways to deploy it — Azure App Service, Azure Container Apps, or even Azure Functions if you prefer serverless. For example, using Azure App Service: Test using curl to ensure it responds with MCP-compatible JSON: Step 2 — Create a New Copilot in Copilot Studio Step 3 — Add Knowledge Sources Optionally, you can enrich your Copilot by adding: This gives your Copilot a baseline knowledge to answer broader questions, while the MCP server will handle specific tasks (like fetching live weather data). Step 4 — Create a Custom Connector in Dataverse To let Copilot Studio talk to our MCP server, we need a custom connector inside Dataverse/CRM. Step 5 — Add the Custom Connector to Copilot Studio you’ll see the MCP server in your Tools section of copilot. To test the setup, let’s ask Copilot: “What’s the current weather in Mumbai?” On the first attempt, Copilot will prompt you to establish a connection. Simply open the Connection Manager, click Connect, and authorize the link to your MCP server. Once connected, Copilot will fetch the live weather details for Mumbai directly from your MCP server. and click retry on the Test window of your copilot. And just like that, your MCP server is live and fully integrated. It can now provide real-time weather updates for any city mentioned in your conversation with Copilot. You can try out different variations of questions or phrasings — Copilot will intelligently interpret your request, extract the city name, and seamlessly call the MCP server to deliver accurate weather details. Beyond Weather: Business Integrations The same process works for enterprise systems. For example, instead of getWeather, you could expose: By publishing these tools via MCP, your Copilot becomes a true enterprise assistant, capable of pulling structured business data and triggering workflows on demand. We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com.

Share Story :

Merging Unmanaged Solutions in Power Platform with XRMToolBox

Let’s say you are developing a module driven app or some custom app development in CRM and multiple teams have created multiple different solutions involving customizations for the develop.  Best would be to have all the customizations in a single solution before and then move it to UAT or Production.  In this blog I will show you how you can move components of multiple solutions into a single main solution using the Solutions Component Mover tool in XRM Tool Box. So let’s begin.  Step 1: Download XRM Tool Box from this link – https://www.xrmtoolbox.com/   Step 2: Make a connection to your Dynamics 365 Environment inside of the XRM Tool Box by clicking on Create a new connection.  Step 2: Click on Microsoft Login Control  Step 3: Click on Open Microsoft Login Control  Step 4: Now Select Display list of available organizations & show advance –> put your username and password -> after successful authentication Name your Connection.  Step 5: Now in Took Library Search for “Solution Component Mover” and hit install.  Step 6: Once the tool is installed it will appear in your tool list click on it   Step 7: once you are in the solution component mover tool click on Load Solution.  To conclude, now, you will get a list of all Managed and Unmanaged solutions. Select the solutions you want to merge in the Source Solution section and select the target solution in which you want to move the components.  All the elements from source solutions will be moved to the target solution (Selected Solutions are highlighted in light grey colour).  Once you have selected the source and target solutions hit Copy Components and we are done.  We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfonts.com.

Share Story :

How to Trim and Remove Spaces from Multiple Columns in Power Query

Efficient data cleaning is a crucial step in any data preparation process, and Power Query makes it easy to handle common tasks like trimming and removing unnecessary spaces with functions that you can apply across multiple columns and queries at once. By creating and invoking a function, you can quickly trim and remove spaces from all the columns & tables you need, saving time and effort. In this blog, we’ll show you how to use Power Query functions to streamline your data-cleaning process. The power query we are going to use to trim text in columns is – (text as text, optional char_to_trim as text) =>letchar = if char_to_trim = null then ” ” else char_to_trim,split = Text.Split(text, char),removeblanks = List.Select(split, each _ <> “”),result=Text.Combine(removeblanks, char)inresult This Power Query function takes text as input and removes extra spaces or a specified character from a text string. It splits the text into parts, filters out empty strings, and recombines the cleaned parts using the specified character. If no character is provided, it defaults to removing spaces. The power query we are going to use to remove spaces from the text is – (InputTxt as text) => let Clendata = Text.Combine(List.Select(Text.Split(Text.Trim(InputTxt),” “),each _ <> “”),“”) in Clendata The Power Query function removes all spaces from a given text string. It trims the input, splits it by spaces, filters out blanks, and then combines the parts into a single string. The result is a clean, space-free text, ideal for standardized data preparation. Now, we have our power query function ready, we can use this function across multiple columns or dataset. To do so, go to Add Column > Invoke Custom Function > Your Power Query Function. To conclude, Cleaning and transforming data in Power Query become much easier and more efficient with the use of custom functions. Whether you need to remove spaces, clean multiple columns, or standardize text, these functions save time and ensure consistency across your dataset. By applying these techniques, you can handle large, messy datasets with ease, making your data ready for analysis or reporting. Start implementing these simple yet powerful methods today to streamline your data preparation process! We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfonts.com.

Share Story :

Data Flow with Array Filtering in Power Automate

When working with arrays in Power Automate, it’s common to need to filter or select a specific item based on certain attributes. Whether you’re handling JSON data from an API, processing records from a list, or managing dynamic content within a flow, efficiently identifying the right item is key. In this blog, we’ll explore a simple yet effective method to extract the desired item from an array using expressions in Power Automate. By the end, you’ll have a clear strategy to streamline your workflows and enhance the intelligence of your automation. In case you need to select an item from an array in Power Automate based on the value of a certain attribute, here’s how you can do it. Scenario You have an array of objects, and each object has a specific attribute. You want to efficiently select the object(s) where this attribute matches a particular value. As you see, the array of objects have different structure – All of them have an attribute called “key” and that’s the one you want to select and then process further. Let’s see how we do it. Filter Array Let’s see how you can select the item from the array based on the value of the “key” attribute instead of looping through all the items and matching. To encapsulate, by using this approach, you can efficiently select specific items from an array based on the value of a particular attribute, making your Power Automate flows more dynamic and tailored to your specific needs. We hope you found this blog useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfonts.com.

Share Story :

All-in-One Guide to C# Plugin Data Types: Working with Strings, Currency, Lookups, and More

In Dynamics 365 and Power Platform, C# plugins play a crucial role in extending the functionality of your applications. One of the key aspect’s developers need to grasp is how to handle various data types effectively. This guide will walk you through the most commonly used data types in C# plugins, including strings, currency, lookups, option sets, and more. Introduction to C# Plugins C# plugins are custom business logic that you can implement in Dynamics 365 to execute in response to specific events, like creating, updating, or deleting records. They allow you to manipulate data and interact with the system in powerful ways. Understanding how to work with different data types is essential for writing effective plugins. Retrieving Entities Before you can manipulate data types, you first need to retrieve the entity record you want to work with. Here’s how you can do that: public void Execute(IServiceProvider serviceProvider){IPluginExecutionContext context =(IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext)); IOrganizationServiceFactory serviceFactory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory)); IOrganizationService service = serviceFactory.CreateOrganizationService(context.UserId); // Retrieve entity by IDEntity entity = service.Retrieve(“entity_logical_name”, context.PrimaryEntityId, new ColumnSet(true));}   Working with Different Data Types String The most common data types are strings. They can represent text values. Getting a String Value: string name = entity.GetAttributeValue<string>(“string_attribute_name”); Setting a String Value: entity[“string_attribute_name”] = “New String Value”; Currency Currency is represented by the Money type in Dynamics 365. Getting a Currency Value: Money amount = entity.GetAttributeValue<Money>(“currency_attribute_name”);decimal currencyValue = amount?.Value ?? 0; Setting a Currency Value: entity[“currency_attribute_name”] = new Money(150.00m); // Set to 150.00 Lookups Lookup fields refer to related entities. They are represented by the EntityReference type. Getting a Lookup Value: EntityReference lookup = entity.GetAttributeValue<EntityReference>(“lookup_attribute_name”); if (lookup != null) {     Guid lookupId = lookup.Id;     string lookupName = lookup.Name; // Requires another retrieve call to get the name} Setting a Lookup Value: entity[“lookup_attribute_name”] = new EntityReference(“related_entity_logical_name”, lookupId); Option Sets (Picklists) Option sets are used to represent a list of choices. They are represented by the OptionSetValue type. Getting an Option Set Value: OptionSetValue optionSetValue = entity.GetAttributeValue<OptionSetValue>(“optionset_attribute_name”); int selectedValue = optionSetValue?.Value ?? 0; Setting an Option Set Value: entity[“optionset_attribute_name”] = new OptionSetValue(1); // Assuming 1 is a valid option Multiselect Option Set Multiselect option sets allow multiple selections from a list. Getting a Value: IEnumerable<OptionSetValue> multiSelectOptions = entity.GetAttributeValue<IEnumerable<OptionSetValue>>(“multiselect_optionset”); Setting a Value: entity[“multiselect_optionset”] = new List<OptionSetValue> {     new OptionSetValue(1),     new OptionSetValue(2) }; // Assuming 1 and 2 are valid options Boolean Values or Two Options Boolean fields represent true/false values. Getting a Boolean Value: bool? isActive = entity.GetAttributeValue<bool?>(“boolean_attribute_name”); Setting a Boolean Value: entity[“boolean_attribute_name”] = true; // or false Getting a Boolean Value: OptionSetValue twoOptionsValue = entity.GetAttributeValue<OptionSetValue>(“two_options_attribute”); bool isSelected = twoOptionsValue?.Value == 1; // Assuming 1 is ‘Yes’ Setting a Boolean Value: entity[“two_options_attribute”] = new OptionSetValue(1); // Set to ‘Yes’ DateTime DateTime fields are used for date and time information. Getting a DateTime Value: DateTime? createdOn = entity.GetAttributeValue<DateTime?>(“datetime_attribute_name”); Setting a DateTime Value: entity[“datetime_attribute_name”] = DateTime.UtcNow; // Set to current date and time Image Image fields store binary data like photos or documents. Getting an Image: var image = entity.GetAttributeValue<EntityImage>(“image_attribute”);byte[] imageData = image?.ImageData; // Assuming you handle the image type properly Whole Number Whole numbers are represented as int. Getting a Value: int wholeNumber = entity.GetAttributeValue<int>(“whole_number_attribute”); Setting a Value: entity[“whole_number_attribute”] = 42; Floating Point Number Floating point numbers allow for decimal values. Getting a Value: float floatingPointNumber = entity.GetAttributeValue<float>(“floating_point_attribute”); Setting a Value: entity[“floating_point_attribute”] = 3.14f; Decimal Number Decimal fields store precise decimal values. Getting a Value: decimal decimalNumber = entity.GetAttributeValue<decimal>(“decimal_number_attribute”); Setting a Value: entity[“decimal_number_attribute”] = 123.45m; Setting Data Types After retrieving the desired values and possibly making changes, you need to update the entity. This is done using the Update method. service.Update(entity);    Some Additional Data Types you Might Encounter in Dynamics 365 C# Plugins such as : 1. Guid Getting a Value: Guid uniqueId = entity.GetAttributeValue<Guid>(“unique_attribute”); Setting a Value: entity[“unique_attribute”] = new Guid(“d3c1d9c8-7438-44b5-91b1-f40241b0f84d”); 2. Composite Fields Getting a Value: string city = entity.GetAttributeValue<string>(“address1_city”); string state = entity.GetAttributeValue<string>(“address1_stateorprovince”); Setting a Value: entity[“address1_city”] = “Seattle”;entity[“address1_stateorprovince”] = “WA”; 3. Unique Identifier (Primary Key) Getting a Value: Guid entityId = entity.Id; Setting a Value: Entity newEntity = new Entity(“entity_logical_name”) {     Id = Guid.NewGuid() }; 4. PartyList (Used in Activities) Getting a Value: string city = entity.GetAttributeValue<string>(“address1_city”); EntityCollection partyList = entity.GetAttributeValue<EntityCollection>(“to”); foreach (Entity party in partyList.Entities) {     EntityReference partyRef = party.GetAttributeValue<EntityReference>(“partyid”);     // Do something with partyRef }   Setting a Value: Entity party = new Entity(“activityparty”); party[“partyid”] = new EntityReference(“contact”, new Guid(“c3e4b159-64af-4c3d-b894-6d62007dbe79”));   EntityCollection partyList = new EntityCollection(new List<Entity> { party }); entity[“to”] = partyList; Conclusion Handling various data types in Dynamics 365 plugins is critical for creating robust and adaptable solutions. Knowing how to work with fields such as text, currencies, lookups, option sets, and others enables you to manage data more precisely and conduct custom activities in our CRM. With these examples, you now have the ability to retrieve and set values for a variety of common data types, making it easy to create plugins that match our organization’s requirements. As you gain experience, you’ll notice that handling data in plugins becomes easier, allowing you to focus on developing smart and effective solutions. We hope you found this article useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com

Share Story :

Integrating Azure Logic Apps with Common Data Service

Integrating Azure Logic Apps with the Common Data Service (CDS) opens up a world of possibilities for automating business processes and enhancing productivity within your organization. This blog will guide you through the steps to set up this integration, explaining the benefits and practical applications along the way. Azure Logic Apps is a powerful cloud-based service that allows you to automate workflows and integrate apps, data, and services across organizations. The Common Data Service, now known as Dataverse, provides a secure and scalable data storage solution that supports integration with various Microsoft and third-party applications. By integrating these two services, you can streamline data flow and automate complex workflows with ease. Prerequisites Before you begin, ensure you have the following: – An active Azure subscription. – Access to the Common Data Service (Dataverse) environment. – Necessary permissions to create and manage Logic Apps and CDS. Log in to the Azure Portal: Go to Azure Portal. Create a New Logic App: – Search for “Logic Apps” in the search bar. – Click on “Add” to create a new Logic App. – Fill in the required details (name, resource group) and click “Create”. Add a CDS Connector: – Once the Logic App is created, open the Workflow and Add one. – Click on “When a row is added” under Common Data Service triggers. – Sign in to your CDS environment and grant the necessary permissions. Configure the Trigger: – Select the relevant entity – Accounts and specify the trigger conditions – When a row is added. – Accordingly, when a record is added then create a Contact Record. – Save the Logic App Testing Out: Scenario – Create a new account in your Dynamics 365 / Power App. After a few moments, refresh and we see the contact has been created and assigned to the new Account. – So, we know our Logic App has run. Now let’s look at it in the Azure portal. Under Metrics, we see the Logic App has run. Why Integrate Azure Logic Apps with Common Data Service? We hope you found this article useful, and if you would like to discuss anything, you can reach out to us at transform@cloudfronts.com

Share Story :

Remove Hover from Primary Navigation Bar Power App Portal

I had a requirement from a client to remove the hover from the header navigation on the customer portal. Here is how we do it, if we inspect, we can see that this is handled by a style element “.navbar-inverse .navbar-nav > li > a:hover“ Now if we removed the background colour here is how it looks. Now let’s make these changes in the code, edit your portal and open the portal in the Power Apps gallery and go to themes. Search for the style element and comment or remove the background colour. Hope this helps!

Share Story :

Here’s how to Install Power Apps for Windows (Preview) and use Model-Driven and Canvas Apps

Hi Everyone,Awaited moment is here, we finally have Power Apps designated application for Windows. Currently its in Preview so use only for testing as of now until its pushed globally. Here’s the steps to download and use Power Apps for Windows Step 1: Go to Microsoft Store and search “Power Apps” Step 2: Install the application. Step 3: In order to run this application, we need to check WebView2 Runtime version on our device. It should be version 99.0 or later. To check this, go to Settings > Apps > Apps & features. Search for WebView and verify that you have version 99.0 or later installed. For those who don’t have this, follow below steps. To install WebView2 Runtime, download the WebView2 Runtime. Download version 99.0 or later. Installing an earlier version may cause Power Apps to crash. Under Evergreen Bootstrapper, select Download. Go over the license terms and privacy statement and then select Accept and Download. When the download is complete, then run the MicroEdgeWebview2Setup.exe. Step 4: Open and sign-in with your ID Step 5: After logging in, you will find list of Model and Canvas Apps that are shared to you or you having access by security roles. The screen will show all Apps from all the environments present in you tenant. You can also see other model-driven apps if you enable Show non-production apps in settings under Model Apps. That’s all about installing Power Apps on Windows. Find the Microsoft Documentation for Installing – Microsoft Docs Find the Usage of Power Apps Windows – Microsoft Docs List of known issues – Microsoft Docs Hope this was informative and helped you.

Share Story :

How to create Dynamic Option-set/List based on value from other fields in Canvas PowerApps

Hi Everyone, Consider a scenario where we want to filter out a dropdown/combo-box choice field based on value in other field or dropdown.Since we cannot use scripts in Canvas App, here’s how we can show specific choice based on multiple values For this example, I’ve considered a bunch of basic items belonging to Fruits, Vegetables and Dairy products. For example purpose I’ll be creating a collection of values to representation. This step will be avoided for choices field within a table/entity.Below is the ‘Master Record’ of collection. Step 1: Create an indexed collection. (referring to MasterList in this example) Step 2: Let’s say we would like to classify the Master List into 3 categories (Fruits, Vegetables and Dairy). In this example, I’ll be using a dropdown list for which the main dropdown field is required to filter data. I’ll be adding a hidden button, containing the following code Based on the above code,Type 1 refers to “Fruits”, Type 2 refers to “Vegetables” and Type 3 refers to “Dairy” Step 3: Added dropdown which will hold classification values. Step 4: The main dropdown choice field which will be filtered based on categories mentioned by above dropdown. That’s it. We have successfully implemented the dynamic choice list as per values dependent on other field. Hope this helps you.

Share Story :

Quick Tip – Duplicate Fields from a Table to another Table

Hello,Consider a scenario where we need to have a table (entity) which is a replica of other table or you need some fields replicated into another table. This tool will save a lot of precious time. Let’s say I have a table called ‘Scoping’ and I want fields from that data replicated into another table called ‘ScopingClone’. Steps you’ll take to do this in a time-efficient manner. Step 1: Create a new Table/Entity. (In my case, I created ScopingClone) Step 2: Navigate to XrmToolBox and install ‘Clone Field Definitions‘, connect to your environment and open the tool. As you can see, the fields that I selected are successfully cloned. I hope you found this blog useful.

Share Story :

SEARCH BLOGS:

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange