Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit 0b4acd9

Browse files
committed
Recover original value on parsing
1 parent 516a48d commit 0b4acd9

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/helpers/VaultManagement.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,5 +170,9 @@ async function obtainQueryResult(query: string, folderPath: string): Promise<Dat
170170
}
171171
}
172172

173-
174-
173+
export function obtainCellFromFile(path: string, column: TableColumn): Literal {
174+
const page = DataviewService.getDataviewAPI().page(path) as NoteInfoPage;
175+
const noteInfo = new NoteInfo(page);
176+
const uniqueRowValue = noteInfo.getRowDataType([column]);
177+
return uniqueRowValue[column.id] as Literal;
178+
}

src/stateManagement/data/handlers/ParseDataOfColumnHandlerAction.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { TableColumn } from "cdm/FolderModel";
22
import { LocalSettings } from "cdm/SettingsModel";
33
import { DataState, TableActionResponse } from "cdm/TableStateInterface";
4+
import { obtainCellFromFile } from "helpers/VaultManagement";
45
import { ParseService } from "services/ParseService";
56
import { AbstractTableAction } from "stateManagement/AbstractTableAction";
67

@@ -10,6 +11,9 @@ export default class ParseDataOfColumnHandlerAction extends AbstractTableAction<
1011
implementation.actions.parseDataOfColumn = (column: TableColumn, input: string, ddbbConfig: LocalSettings) =>
1112
set((updater) => {
1213
const parsedRows = updater.rows.map((row) => {
14+
// Recover original value
15+
const dvCell = obtainCellFromFile(row.__note__.filepath, column);
16+
row[column.key] = dvCell;
1317
// Transform the input into the target type
1418
const parsedValue = ParseService.parseRowToCell(
1519
row,

0 commit comments

Comments
 (0)