Muokkaa

Jaa


Web API Data operations Samples (PowerShell)

This article provides common understanding about Web API samples using PowerShell. Currently, there's only one sample, but we plan to add more. While each sample focuses on a different aspect of Microsoft Dataverse Web API, they all follow similar process and structure described in this article.

Web API Samples using PowerShell

The following samples use the patterns described here:

Sample Sample Group Description
Web API Basic Operations Sample (PowerShell) Web API Basic Operations Sample Demonstrates how to create, retrieve, update, delete, associate and disassociate Dataverse table rows (entity records).
Not available yet Web API Query Data Sample Demonstrates how to use OData v4 query syntax and functions and Dataverse query functions. Includes examples of working with predefined queries and using FetchXML to perform queries.
Not available yet Web API Conditional Operations Sample Demonstrates how to perform conditional operations you specify with ETag criteria.
Not available yet Web API Functions and Actions Sample Demonstrates how to use bound and unbound functions and actions, including custom actions.
Web API table schema operations sample (PowerShell) Web API table schema operations sample Demonstrates how to perform selected operations that modify the Dataverse schema, or metadata.

Prerequisites

Before running these samples, you should read these articles that explain concepts and patterns used by these samples:

These samples have the same prerequisites.

Install or verify that the following are installed

Verify installation

  1. Open Visual Studio Code.

  2. In the Terminal menu, select New Terminal.

  3. In Visual Studio Code navigation pane, select the icon for the PowerShell extension.

  4. Copy and paste the following script in the Visual Studio Code terminal window:

    Write-Host 'PowerShell Version:'$PSVersionTable.PSVersion.ToString()
    Write-Host 'PowerShell Az version:'(Get-InstalledModule Az).Version
    
  5. Press Enter. The output should resemble the following:

    PowerShell Version: 7.4.0
    PowerShell Az version: 11.1.0
    

If you don't see results like this, install or update the prerequisites.

You'll also need

  • A valid user account for a Dataverse environment
  • The Url to the Dataverse environment you want to connect to. See View developer resources to learn how to find it. It looks something like this: https://yourorg.crm.dynamics.com/, where yourorg.crm is different.
  • Basic understanding of the PowerShell scripting language

See also

Use the Dataverse Web API
Quick Start Web API with PowerShell and Visual Studio Code
Use PowerShell and Visual Studio Code with the Dataverse Web API
Web API Samples