# Dataview Integration for Todoist Context Bridge
Todoist Context Bridge integrates with [Dataview](https://github.com/blacksmithgu/obsidian-dataview) to provide flexible task metadata handling.
## Due Date Support
The plugin can extract due dates from Dataview metadata fields:
1. Configure the due date field name in settings (default: `due`)
2. Add due dates in any format Dataview supports:
```markdown
- [ ] Task due tomorrow [due::2025-01-01]
```
## Priority Support
The plugin recognizes Dataview priority values in various formats:
- Numeric: `1`, `2`, `3`, `4`
- Text: `high`, `medium`, `low`, `none`
- Additional: `p1`, `p2`, `p3`, `p4`
Default priority mappings to Todoist:
- `1`, `high`, `p1` → Priority 1 (High)
- `2`, `medium`, `p2` → Priority 2 (Medium)
- `3`, `low`, `p3` → Priority 3 (Low)
- `4`, `none`, `p4` → Priority 4 (None)
To use Dataview priorities, add priority using any of the supported formats:
```markdown
- [ ] Important task [priority::1]
- [ ] Medium task [p::2]
- [ ] Low priority task [priority:: low]
```
## Cleanup Patterns
By default, the plugin removes Dataview metadata when syncing to Todoist:
1. Priority fields: `priority`, `p`
2. Due date fields: configurable via settings
3. Custom fields: add [[Text Cleanup Patterns for Todoist Context Bridge#Dataview Cleanup|additional fields]] to clean up in settings
## Settings
In the plugin settings, you can:
1. **Configure Field Names:**
- Due Date Key (default: `due`)
- Priority Key (default: `priority` or `p`)
- Additional cleanup keys
2. **Customize Priority Mappings:**
- Map your own priority values to Todoist priorities
- Add new priority terms or modify existing ones
3. **Choose Preferred Formats:**
- Due Date Format: Tasks or Dataview
- Priority Format: Tasks or Dataview
## Example Usage
```markdown
- [ ] Project meeting [priority::high] [due::2025-01-01]
```
This task will be synced to Todoist with:
- Priority 1 (from `high`)
- Due date set to `2025-01-01`
- Clean text "Project meeting" (metadata removed)
## Using Both Dataview and Tasks Plugin
When both Dataview and Tasks plugin support are enabled:
1. **Due Date:**
- Choose your preferred format in settings
- Both formats are recognized in task text
- The selected format determines which date is used if both are present
2. **Priority:**
- Choose your preferred format in settings
- The task creation modal will show both formats
- The selected format determines which priority value is used