umbraco-picker-data-source
Implement custom picker data sources for property editors in Umbraco backoffice
What this skill does
# Umbraco Picker Data Source
## What is it?
A Picker Data Source provides data for picker-based property editors. It allows you to create custom data sources that supply items for content pickers, defining how items are fetched, searched, and displayed in a tree or collection format. This is useful for creating pickers that select from custom entities, external APIs, or filtered subsets of existing content.
## Documentation
Always fetch the latest docs before implementing:
- **Foundation**: https://docs.umbraco.com/umbraco-cms/customizing/foundation
- **Extension Registry**: https://docs.umbraco.com/umbraco-cms/customizing/extending-overview/extension-registry
- **Property Editors**: https://docs.umbraco.com/umbraco-cms/customizing/property-editors
## Reference Example
The Umbraco source includes working examples:
**Location**: `/Umbraco-CMS/src/Umbraco.Web.UI.Client/examples/picker-data-source/`
This example demonstrates multiple picker data source implementations:
- Custom collection picker
- Custom tree picker with search
- Document picker with start node configuration
- Media, Language, Webhook, and User pickers
## Related Foundation Skills
- **Repository Pattern**: For data fetching patterns
- Reference skill: `umbraco-repository-pattern`
- **Tree**: For tree-based picker data sources
- Reference skill: `umbraco-tree`
## Workflow
1. **Fetch docs** - Use WebFetch on the URLs above
2. **Ask questions** - What data to pick? Tree or collection? Search needed? Configuration options?
3. **Generate files** - Create manifest + data source class based on latest docs
4. **Explain** - Show what was created and how to use with a property editor
---
## Manifest Example
```typescript
import { UMB_PICKER_DATA_SOURCE_TYPE } from '@umbraco-cms/backoffice/picker-data-source';
export const manifests: Array<UmbExtensionManifest> = [
{
type: 'propertyEditorDataSource',
dataSourceType: UMB_PICKER_DATA_SOURCE_TYPE,
alias: 'My.PropertyEditorDataSource.CustomPicker',
name: 'Custom Picker Data Source',
api: () => import('./my-picker-data-source.js'),
meta: {
label: 'Custom Items',
icon: 'icon-list',
description: 'Pick from custom items',
},
},
];
```
---
## Tree Picker Data Source
For hierarchical data with parent-child relationships:
```typescript
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
import type {
UmbPickerSearchableDataSource,
UmbPickerTreeDataSource,
} from '@umbraco-cms/backoffice/picker-data-source';
import type { UmbSearchRequestArgs, UmbSearchResultItemModel } from '@umbraco-cms/backoffice/search';
import type { UmbTreeChildrenOfRequestArgs, UmbTreeItemModel } from '@umbraco-cms/backoffice/tree';
export class MyPickerTreeDataSource
extends UmbControllerBase
implements UmbPickerTreeDataSource, UmbPickerSearchableDataSource
{
// Filter function to determine which items can be picked
treePickableFilter: (treeItem: UmbTreeItemModel) => boolean = (treeItem) =>
!!treeItem.unique && treeItem.entityType === 'my-entity';
searchPickableFilter: (searchItem: UmbSearchResultItemModel) => boolean = (searchItem) =>
!!searchItem.unique && searchItem.entityType === 'my-entity';
// Return the root node (container for all items)
async requestTreeRoot() {
return {
data: {
unique: null,
name: 'My Items',
icon: 'icon-folder',
hasChildren: true,
entityType: 'my-entity-root',
isFolder: true,
},
};
}
// Return items at the root level
async requestTreeRootItems() {
const rootItems = myItems.filter((item) => item.parent.unique === null);
return {
data: {
items: rootItems,
total: rootItems.length,
},
};
}
// Return children of a specific item
async requestTreeItemsOf(args: UmbTreeChildrenOfRequestArgs) {
const items = myItems.filter(
(item) =>
item.parent.entityType === args.parent.entityType &&
item.parent.unique === args.parent.unique
);
return {
data: {
items: items,
total: items.length,
},
};
}
// Return ancestors for breadcrumb navigation
async requestTreeItemAncestors() {
return { data: [] };
}
// Return specific items by their unique IDs
async requestItems(uniques: Array<string>) {
const items = myItems.filter((x) => uniques.includes(x.unique));
return { data: items };
}
// Search items by query string
async search(args: UmbSearchRequestArgs) {
const result = myItems.filter((item) =>
item.name.toLowerCase().includes(args.query.toLowerCase())
);
return {
data: {
items: result,
total: result.length,
},
};
}
}
export { MyPickerTreeDataSource as api };
// Sample data
const myItems: Array<UmbTreeItemModel> = [
{
unique: '1',
entityType: 'my-entity',
name: 'Item 1',
icon: 'icon-document',
parent: { unique: null, entityType: 'my-entity-root' },
isFolder: false,
hasChildren: false,
},
{
unique: '2',
entityType: 'my-entity',
name: 'Item 2',
icon: 'icon-document',
parent: { unique: null, entityType: 'my-entity-root' },
isFolder: false,
hasChildren: false,
},
];
```
---
## Collection Picker Data Source
For flat lists without hierarchy:
```typescript
import { UmbControllerBase } from '@umbraco-cms/backoffice/class-api';
import type { UmbPickerCollectionDataSource } from '@umbraco-cms/backoffice/picker-data-source';
import type { UmbCollectionItemModel } from '@umbraco-cms/backoffice/collection';
export class MyPickerCollectionDataSource
extends UmbControllerBase
implements UmbPickerCollectionDataSource
{
async requestCollection() {
const items: UmbCollectionItemModel[] = [
{ unique: '1', entityType: 'my-entity', name: 'Item 1', icon: 'icon-document' },
{ unique: '2', entityType: 'my-entity', name: 'Item 2', icon: 'icon-document' },
{ unique: '3', entityType: 'my-entity', name: 'Item 3', icon: 'icon-document' },
];
return {
data: {
items,
total: items.length,
},
};
}
async requestItems(uniques: Array<string>) {
// Return specific items by unique IDs
const allItems = await this.requestCollection();
const items = allItems.data.items.filter((x) => uniques.includes(x.unique));
return { data: items };
}
}
export { MyPickerCollectionDataSource as api };
```
---
## Data Source with Configuration
Add settings to your picker data source:
```typescript
export const manifests: Array<UmbExtensionManifest> = [
{
type: 'propertyEditorDataSource',
dataSourceType: UMB_PICKER_DATA_SOURCE_TYPE,
alias: 'My.PropertyEditorDataSource.ConfigurablePicker',
name: 'Configurable Picker Data Source',
api: () => import('./my-configurable-picker-data-source.js'),
meta: {
label: 'Configurable Items',
icon: 'icon-settings',
description: 'Pick items with configuration options',
settings: {
properties: [
{
alias: 'startNode',
label: 'Start Node',
description: 'Select where to start picking from',
propertyEditorUiAlias: 'Umb.PropertyEditorUi.ContentPicker.Source',
},
{
alias: 'filter',
label: 'Filter Types',
description: 'Select which types can be picked',
propertyEditorUiAlias: 'Umb.PropertyEditorUi.ContentPicker.SourceType',
},
],
},
},
},
];
```
---
## Interfaces
```typescript
interface UmbPickerTreeDataSource {
treePickableFilter?: (treeItem: UmbTreeItemModel) => boolean;
requRelated in General
modeling-omnistudio-epc-catalog
IncludedSalesforce Industries CME EPC product-modeling skill for Product2-based catalog creation. Use when creating EPC products, configuring product attributes, building offer bundles with Product Child Items, or reviewing EPC DataPack JSON metadata for product catalog changes. TRIGGER when: user creates or updates Product2 EPC records, AttributeAssignment payloads, AttributeMetadata/AttributeDefaultValues, Offer bundles, or ProductChildItem relationships. DO NOT TRIGGER when: designing OmniScripts/FlexCards/Integration Procedures (use building-omnistudio-omniscript, building-omnistudio-flexcard, or building-omnistudio-integration-procedure), implementing Apex business logic (use generating-apex), or troubleshooting deployment pipelines (use deploying-metadata).
relationship-science-coach
IncludedUse this skill for direct, practical adult relationship coaching: couples conflict, repair, trust, marriage, dating, flirting, attachment patterns, emotional connection, sex, desire differences, eroticism, kink negotiation, affection, love languages, breakups, and long-term passion. Draw on Gottman, EFT and Hold Me Tight, attachment science, modern sex research, Perel, Nagoski, Kerner, Schnarch, Love and Stosny, and flexible love-language tools. Be concrete and low-hedge. Redirect only for imminent danger, abuse, coercive control, minors, non-consent, self-harm, stalking, or medical/legal/psychiatric decisions.
building-sf-integrations
IncludedSalesforce integration architecture and runtime plumbing with 120-point scoring. Use this skill to set up Named Credentials, External Credentials, External Services, REST/SOAP callout patterns, Platform Events, and Change Data Capture. TRIGGER when: user sets up Named Credentials, External Services, REST/SOAP callouts, Platform Events, CDC, or touches .namedCredential-meta.xml files. DO NOT TRIGGER when: Connected App/OAuth config (use configuring-connected-apps), Apex-only logic (use generating-apex), or data import/export (use handling-sf-data).
venue-templates
IncludedAccess comprehensive LaTeX templates, formatting requirements, and submission guidelines for major scientific publication venues (Nature, Science, PLOS, IEEE, ACM), academic conferences (NeurIPS, ICML, CVPR, CHI), research posters, and grant proposals (NSF, NIH, DOE, DARPA). This skill should be used when preparing manuscripts for journal submission, conference papers, research posters, or grant proposals and need venue-specific formatting requirements and templates.
let-fate-decide
IncludedDraws the 12 Houses of the Zodiac Tarot spread to inject entropy into planning when prompts are vague, ambiguous, or casually delegated. Interprets the spread to guide next steps. Use when the user says 'let fate decide', 'YOLO', 'whatever', 'idk', or other nonchalant phrases, makes Yu-Gi-Oh references, or when you are about to arbitrarily pick between multiple reasonable approaches. Prefer over ask-questions-if-underspecified when the user's tone is casual or playful rather than precision-seeking.
net-ops
IncludedCross-platform network troubleshooting (Windows, macOS, Linux) via local or remote shell. Use for: DNS broken, can't resolve hostnames, nslookup/dig works but apps fail, NRPT, WFP, scutil, /etc/resolver, systemd-resolved, /etc/resolv.conf, NetworkManager, VPN DNS leak residue (ProtonVPN/Mullvad/WireGuard/AnyConnect), AV/firewall blocking DNS or DoH, Tailscale DNS interaction, intermittent connectivity, remote diagnostics over SSH.