English
excelImport.parseFormData.before
About 154 wordsLess than 1 minute
2026-05-08
Execution Timing
Before parsing Excel import form data
Parameters
| Parameter | Description | Type |
|---|---|---|
| data | Form data | Object |
| param | Import parameter object | Object |
Return Result
| Parameter | Description | Type |
|---|---|---|
| data | Processed form data | Object |
Notes
- This hook is triggered before Excel import form data is parsed and can be used to preprocess or modify form data.
- When returned
dataexists, the system replaces the original data with the returned data. - If no data is returned or the returned
datais empty, the system continues using the original data.
Code Example
export default class Plugin {
apply() {
return [{
event: "excelImport.parseFormData.before",
functional: this.parseFormData.bind(this)
},
];
}
async parseFormData(context){
let { data, param } = context;
// Preprocess form data based on business logic
const processedData = this.preprocessFormData(data, param);
return{
data: processedData
}
}
preprocessFormData(data, param) {
// Custom business logic for preprocessing form data
// For example, add default values, format data, validate data, and so on
return {
...data,
};
}
}