-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get data from API in Custom function #1119
Comments
Hi, @callmehero. Thanks for your feedback. HyperFormula does not support asynchronous custom functions at its current development stage. We discussed this idea a while ago, but at the moment, we prioritize bug and interoperability fixes, so this feature is not on our immediate roadmap. But, as @warpech wrote in #9 (comment):
In your case, I think you can try this approach:
Does it make sense for your use case? |
Closing. @callmehero, if you have any further questions related to this issue, reopen it, please. |
I have a question related to this: I want
Thanks sequba - would there be a way to reference local data in a custom formula in React? I was trying to follow the documentation - wasn't sure how to reference variables in the formula that were not the input variables. Grateful for your assistance. |
Hi @abhii-bit! @sequba answered the same subject here #808 (reply in thread) |
@abhii-bit @callmehero We have just released HyperFormula 2.7.0 which adds a context configuration parameter that can be used to reference local data in a custom formula. |
The current solution only deals with async cells that do not depend on other async cells. If this were to be integrated with Handsontable, is there a hook that gets invoked after rebuildAndRecalculate() is done? |
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
Links
The text was updated successfully, but these errors were encountered: