How to call modal from Javascript

So I have a form that is loaded from an API. There is javascript that calls the code. When there is an error message I want to load a modal and display the error message. Could also be a toast or notification. I just want to call the wappler component from the javascript. Any ideas on how to do that, I"m not the best javascript guy ever…

Currently it just writes the error to the console

Capture

dmx.parse('modalname.show()');
1 Like

oh wow super simple. Awesome thanks! I can just run any wappler command from the dmx.parse then?

Correct

1 Like

You can call app connect components this way and also pass your js variables as values, like:

dmx.parse('toasts1.show({message: “' + error + '”, delay: 5000})');
1 Like