plugins/dataverse/skills/dataverse-queries/SKILL.md
# dataverse-queries This skill provides guidance on querying data from Microsoft Dataverse. Use when users ask about "Dataverse query", "OData filter", "Dataverse SQL", "FetchXML", "query Dataverse records", "Dataverse filter syntax", "search Dataverse", or need help constructing queries. ## Query Methods The Dataverse SDK supports two query methods: 1. **OData queries** - Standard Web API query syntax 2. **SQL queries** - T-SQL-like syntax (read-only) ## OData Query Basics ```python # Basi
npx skillsauth add sahib-sawhney-wh/sahibs-claude-plugin-marketplace plugins/dataverse/skills/dataverse-queriesInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
This skill provides guidance on querying data from Microsoft Dataverse. Use when users ask about "Dataverse query", "OData filter", "Dataverse SQL", "FetchXML", "query Dataverse records", "Dataverse filter syntax", "search Dataverse", or need help constructing queries.
The Dataverse SDK supports two query methods:
# Basic query - returns all records (paged)
pages = client.get("account")
# With parameters
pages = client.get(
"account",
select=["name", "telephone1"], # Columns to return
filter="statecode eq 0", # Filter expression
orderby=["name asc"], # Sort order
top=100, # Max records
expand=["primarycontactid"] # Related records
)
# Process results
for page in pages:
for record in page:
print(record["name"])
| Operator | Description | Example |
|----------|-------------|---------|
| eq | Equal | statecode eq 0 |
| ne | Not equal | name ne null |
| gt | Greater than | revenue gt 1000000 |
| ge | Greater or equal | createdon ge 2024-01-01 |
| lt | Less than | quantity lt 10 |
| le | Less or equal | amount le 500 |
# AND
filter="statecode eq 0 and revenue gt 1000000"
# OR
filter="name eq 'Contoso' or name eq 'Fabrikam'"
# NOT
filter="not contains(name, 'test')"
# Combined
filter="(statecode eq 0) and (revenue gt 1000000 or numberofemployees gt 100)"
# Contains
filter="contains(name, 'Contoso')"
# Starts with
filter="startswith(name, 'A')"
# Ends with
filter="endswith(emailaddress1, '@contoso.com')"
# Specific date
filter="createdon ge 2024-01-01"
# Date range
filter="createdon ge 2024-01-01 and createdon lt 2024-02-01"
# Today (use ISO format)
from datetime import datetime
today = datetime.now().strftime("%Y-%m-%d")
filter=f"createdon ge {today}"
# Is null
filter="telephone1 eq null"
# Is not null
filter="telephone1 ne null"
SQL queries are read-only and support a subset of T-SQL.
# Basic SELECT
results = client.query_sql(
"SELECT name, telephone1 FROM account WHERE statecode = 0"
)
# With TOP
results = client.query_sql(
"SELECT TOP 10 name FROM account ORDER BY createdon DESC"
)
# With aggregates
results = client.query_sql(
"SELECT industrycode, COUNT(*) as count "
"FROM account "
"GROUP BY industrycode"
)
# Automatic paging (iterator)
all_records = []
pages = client.get("account", top=5000)
for page in pages:
all_records.extend(page)
# Control page size
pages = client.get("account", page_size=500)
# Break early
pages = client.get("account", top=1000)
count = 0
for page in pages:
for record in page:
count += 1
if count >= 100:
break
if count >= 100:
break
Always specify columns to reduce payload:
# Good - only needed columns
pages = client.get(
"account",
select=["accountid", "name", "telephone1"]
)
# Bad - returns all columns (slower)
pages = client.get("account")
# Expand single relationship
pages = client.get(
"account",
select=["name"],
expand=["primarycontactid"]
)
# Access expanded data
for page in pages:
for account in page:
contact = account.get("primarycontactid", {})
print(f"{account['name']}: {contact.get('fullname')}")
# Single column ascending
orderby=["name"]
# Single column descending
orderby=["createdon desc"]
# Multiple columns
orderby=["statecode", "name asc", "createdon desc"]
pages = client.get("account", filter="statecode eq 0")
pages = client.get(
"account",
filter="createdon ge 2024-01-01",
orderby=["createdon desc"]
)
pages = client.get(
"account",
filter="contains(name, 'Contoso')"
)
pages = client.get(
"account",
filter=f"_ownerid_value eq {user_id}"
)
pages = client.get("account", filter="statecode eq 0")
count = sum(len(page) for page in pages)
references/odata-syntax.md for complete OData referencereferences/sql-queries.md for SQL query examplestools
# dataverse-web-apps This skill provides guidance on building web applications (any language) that connect to Microsoft Dataverse. Use when users ask about ".NET Dataverse", "Node.js Dataverse", "JavaScript Dataverse", "REST API Dataverse", "web app Dataverse", "OAuth Dataverse", or need help with web application integration. ## Dataverse Web API All languages can access Dataverse via the OData Web API. **Base URL:** `https://yourorg.api.crm.dynamics.com/api/data/v9.2/` ### Authentication
tools
# dataverse-sdk This skill provides guidance on using the PowerPlatform Dataverse Client SDK for Python. Use when users ask about "Dataverse SDK", "Dataverse Python", "DataverseClient", "Dataverse authentication", "Dataverse CRUD operations", "create Dataverse records", "query Dataverse", "Dataverse connection", or need help with the Microsoft Dataverse Python SDK. ## Quick Start Install the SDK: ```bash pip install PowerPlatform-Dataverse-Client azure-identity ``` Basic setup: ```python fro
tools
# dataverse-schema-design This skill provides guidance on designing Dataverse table schemas and data models. Use when users ask about "Dataverse table design", "Dataverse schema", "Dataverse relationships", "Dataverse columns", "data modeling Dataverse", "Dataverse best practices", or need help designing their data structure. ## Table Design Fundamentals ### Naming Conventions - **Table prefix**: Use publisher prefix (e.g., `new_`, `cr123_`) - **Table names**: PascalCase, singular (e.g., `new
tools
# dataverse-python-apps This skill provides guidance on building Python applications that use Microsoft Dataverse as a database. Use when users ask about "Python Dataverse app", "Flask Dataverse", "FastAPI Dataverse", "Dataverse backend", "Python API with Dataverse", "Dataverse data pipeline", or need help building Python applications with Dataverse. ## Architecture Patterns ### Basic Application Structure ``` my-dataverse-app/ ├── app/ │ ├── __init__.py │ ├── dataverse_client.py # Dat