Import Data into a Many-to-Many Relationship Table in Dataverse

Importing data into a table in Dataverse auto-created by a many-to-many relationship proves to be much less straight-forward than it ought to be. For example, PowerApps Dataflows don't support importing to them. In this post, I’ll showcase two methods to import data using both Power Automate and the Dataverse Web API. Scenario: The Auto Inventory Manager I have this Dataverse data model for my Auto Inventory Management solution: Many Models can belong to a single make. That's a classic Many-To-One relationship. However, many models come in many different body styles. (Ex: a Honda Civic comes in a hatchback…

Comments Off on Import Data into a Many-to-Many Relationship Table in Dataverse

Hide a Business Process Flow Using JavaScript

In some scenarios, you may want to hide a Business Process Flow (BPF) once the entire process is complete. In this post, we’ll walk through how to achieve this in a model-driven app using JavaScript. Once the last stage is completed, the JS code hides the control. The Methodology We can use the formContext.data.process client API to determine the status of the BPF with the getStatus method. When the process is complete, this method returns the string value "finished". Then, call the formContext.ui.process.setVisible method to hide or show it. Applying the Code Create a new web resource and…

Comments Off on Hide a Business Process Flow Using JavaScript

Write to Dataverse Notes Table using Web API

I had a challenge recently where I needed to migrate hundreds of notes from an old database to the Dataverse. Dataverse has an Out of the Box Notes table (logical name “annotations”) that allows for recording notes and attachments against a related table. This post will showcase the preparation steps and PowerShell script used to do just that. Preparation Steps Enable Notes and Attachments For this example, let’s assume we are trying to write rows from a csv into the notes table regarding Purchase Orders. First, ensure the table has the option “Enable Attachments (including notes and files)”…

Comments Off on Write to Dataverse Notes Table using Web API

Fetch a List of PowerApps across Environments

One of the challenges I’ve faced when using the Power Apps Admin Center is getting a quick view of all the apps within all environments for documentation purposes. Sure, you can go into each environment's Admin Center and view the apps, but this is not efficient. Even worse, from there, there's no way export the a list of the apps! To solve this, I explored several options before landing on the approach I describe below. First, I tried PowerShell with the Get-AdminPowerApp cmdlet—but that only returns Canvas App data. No Model-Driven Apps in sight. Then I turned to…

Comments Off on Fetch a List of PowerApps across Environments

Working with Dataverse Column Data Types using Web API

This guide covers how to create and update common Dataverse column data types using the Dataverse Web API with PowerShell. While standard types are relatively simple to handle, complex types like Lookup require specific formatting and payload structure to be processed correctly. The Basics I already covered the basic CRUD operations using the Web API so I strongly recommend reviewing this post first. Basically, you'll either be using the methods post for create and patch for update. Then, we will pass the payload containing all the columns we want to create or update. We also need to ensure…

Comments Off on Working with Dataverse Column Data Types using Web API

Query Dataverse FAST with FetchXML Builder

One of the must-have tools for every Power Platform developer is XRMToolBox. Within it is a tool called FetchXML Builder, which lets us connect to our Dataverse environment, browse and query data easily, and export the results in various formats. Don’t let the name 'FetchXML' fool you—it does much more than just fetch XML! We can also convert the query output to OData (Web API) format for use with our scripts. This post is part of my ongoing series on using the Dataverse Web API with PowerShell. Make sure you have read through my post on Obtaining an…

Comments Off on Query Dataverse FAST with FetchXML Builder

Perform CRUD Operations using the Dataverse Web API

Being able to perform CRUD (Create/Read/Update/Delete) Operations in Dataverse is a fundamental task you'll likely be doing a lot when working with the Web API. I'll show you some common practical examples of how to perform this. This is a continuation in my series on using the Dataverse Web API and PowerShell scripting. If you haven't already, please read my post on Obtaining an Access Token, as you will need to know how to do this first. For my examples, I will be using the Dataverse Contacts Table because it is a standard table every Dataverse environment has…

Comments Off on Perform CRUD Operations using the Dataverse Web API