I am seeking assistance with a TypeScript function related to ontology objects. I want to develop a TypeScript program that accepts a dataframe as input. The objective is to nullify the values in other columns when a value from a row in a particular column is removed.
Below is an example of a dataframe:
ID | level | responsible | description |
---|---|---|---|
A12 | level2 | NG34Jean | Sheet |
B15 | level5 | NG90Elis | Bellow |
C67 | level4 | NG64Matire | Clamp |
H65 | level3 | NG45Louis | Cubical |
J90 | level0 | NG08Marie | Blech |
To illustrate, for the ID = B15, I wish to remove its level i.e. "level5", leading the values of "responsible" and "description" to be equal to "Null".
Moreover, for the ID = H65, I aim to eliminate its level i.e. "level3", resulting in the values of "responsible" and "description" being set to "Null".
Here is how the dataframe will look post these modifications:
ID | level | responsible | description |
---|---|---|---|
A12 | level2 | NG34Jean | Sheet |
B15 | No value | null | null |
C67 | level4 | NG64Matire | Clamp |
H65 | No value | null | null |
J90 | level0 | NG08Marie | Blech |
@OntologyEditFunction()
public async deletevaluetable(
objectpart: ObjectPartsNew[],
ID?: string,
level?: string,
responsible?: string,
description?: string,
): Promise<void> {
function deletevaluetable() {
var manual;
for (var i = 0; i < objectpart.length; i++) {
manual=objectpart[i];
var updates = 0;
const properties_dict: manualUpdate = {
"manual": ID,
};
.....
}
}
}