Run Javascript code after server connect call

Hi,

I need to call a Javascript function after a server connect call succeeds, but I’m having trouble doing it:

It throws an error in console (something like window[e] is undefined)

Is that an inline flow? Can you post the exact code of the success event here?

Yes, this is the HTML code:

<dmx-serverconnect id="sc_stuff" url="/api/stuff" dmx-on:success="run([{wait:{delay:300}},{runJS:{function:`console.log`,args:[1]}}])"></dmx-serverconnect>

In the function option in the flow UI you need to enter a function name.
Example, you have this function:

<script>
    function myfunc(myarg) {
        console.log(myarg);
    }
</script>

and the success events has this:

run([{wait:{delay:300}},{runJS:{function:'myfunc',args:['some value']}}])