Making a JS script async

Hi Team

Is there a way to define a JS script as async, via parameters, so that the result value can be updated based on a web request result?
I’m working on a script via the UI, not via a package, so I couldn’t find a good example.

Thanks

I think I figured myself that you cannot work with output parameters as part of an async function

It should work like this:

//name: Template
//description: Hello world script
//language: javascript
//output: int test
var a = await grok.functions.eval('testData("demog")');
test = a.rowCount;

May be, there is another bug, can you send me a code snippet?

ok, so the function itself is already async - so yes, this did work. Thanks

2 Likes