odata-execution
Original:🇺🇸 English
Translated
Use when building or testing OData queries with dxs odata execute: incremental query development, verifying $select/$expand/$filter clauses, or diagnosing query errors against a Footprint API connection.
8installs
Sourcedatex/skills
Added on
NPX Install
npx skill4agent add datex/skills odata-executionTags
Translated version includes tags in frontmatterSKILL.md Content
View Translation Comparison →OData Execution
Build, test, and verify OData queries incrementally using .
dxs odata executeReferences
- references/filter-patterns.md — Lambda operators, string functions, SQL-to-OData mappings
Input/Output Contract
Input: Connection ID + entity knowledge (field names, navigation properties — from schema-explorer or conversation context)
Output: Verified OData query string (in conversation context, not a file)
Workflow — Incremental Query Building
Build queries one layer at a time. Large queries timeout, and adding one expand at a time isolates problems. A 400 on means the field name is wrong — check , don't drop .
$selectschema properties$selectStep 1: Base entity with $select
$selectStart with the root entity and only its scalar fields:
bash
dxs odata execute -c <id> -q 'Entity?$top=1&$select=Id,Field1,Field2'Step 2: Add one-to-one expands
Add navigation properties that return a single related entity:
bash
dxs odata execute -c <id> -q 'Entity?$top=1&$select=Id,Field1&$expand=Account($select=Id,Name),Status($select=Id,Name)'Step 3: Add collection expands with nested expands
Add navigation properties that return collections, including any nested expansions:
bash
dxs odata execute -c <id> -q 'Entity?$top=1&$select=Id,Field1&$expand=Lines($select=Id,LineNumber;$expand=OrderLine($select=OrderId;$expand=Material($select=Id,Name)))'Step 4: Combine everything into the full query
Merge all verified layers into the final query. Only at this point should you remove (if appropriate for the use case).
$top=1Push Filtering Server-Side
Before accepting client-side filtering, verify whether the logic can be expressed in . OData supports lambda operators for collection filtering, string functions, and nested in . See references/filter-patterns.md for the full pattern library.
$filter$filter$expandParameterized Queries (Key Segment)
For single-entity queries, use key segment syntax: . The is a placeholder. Validate query structure with first, then switch to .
Entity(0)0Entity?$top=1Entity(0)Entity(0)bash
# First: validate structure
dxs odata execute -c <id> -q 'Entity?$top=1&$select=Id,Field1&$expand=Status($select=Id,Name)'
# Then: switch to key segment
dxs odata execute -c <id> -q 'Entity(0)?$select=Id,Field1&$expand=Status($select=Id,Name)'Critical Rules
| Rule | Detail |
|---|---|
| Use during testing to avoid timeouts |
| Single quotes | Always use |
| Required on every expand clause |
| Nested option separator | Semicolons ( |
400 on | Field name is wrong — check |
| Composite keys | Check |
Common Mistakes
| Mistake | Fix |
|---|---|
| Always include |
Double quotes for | Use single quotes — shell expands |
Not using | Large queries timeout — always limit during development |
Testing with | 404 is expected — validate structure via |