-
Notifications
You must be signed in to change notification settings - Fork 154
Get data from API in Custom function #1119
Copy link
Copy link
Closed
Labels
QuestionFurther information is requestedFurther information is requested
Description
Description
I am using runfunction in FunctionPlugin for showing API result. but it not working as expected due to return executed before the api response.
SO I used to promise inside the fn param but it showing this error
ERROR:
Argument of type ‘(result: any) => Promise’ is not assignable to parameter of type ‘(…arg: any) => InterpreterValue’.
Type ‘Promise’ is not assignable to type ‘InterpreterValue’.ts(2345)
Steps to reproduce
return this.runFunction(
ast.args,
state,
this.metadata("VLOOKUPSHEETFN"),
(param) => {
let item = this.paramFn();
console.log("skjdbvds", item);
return new Promise((resolve, reject) => {
return item = Api call result
});
return Hello , ${item}!;
},
);
Demo
Your environment
angular 13
- HyperFormula version: 12.0.1 (handsontable version)
- Browser Name and version: chrome latest
- Operating System: Windows
Links
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
QuestionFurther information is requestedFurther information is requested