Triggering a flow from JS

Is it possible to use dmx.parse or similar to trigger a flow from JS?

OK, so it appears you can use dmx.parse('flowname.run()') but it wasn’t working for me because the flow was located on a routed content page. It appears they have to be on the main index page. I moved the flow and it works.

1 Like

To run anything on route pages, just qualify the control with route name.
So it would be dmx.parse('route1.flowname.run()').

You can check the qualification of all control/components on the app by hit-and-trialing dmx.app.data.... in the console of your browser. And then use full qualification in dmx.parse as needed.
You can also run all the dmx functions/formatters etc using dmx.parse in JS. But the same functions/formatters are not (usually) accessible directly via dmx.app.data....

1 Like

Thanks @sid,
As you may have seen from the other thread you’ve been helping with, I had based the dmx.parse statement on what the UI had given me from the data picker. Unfortunately it dousn’t seem to recognise when items are within routes so doesn’t add the required route id as part of the statement - hence I thought it wasn’t working.

Yeah… That is a bug. It works fine mostly.
Also, when you are in the route, you don’t need the route qualification since the components are local to the page.
But when running dmx.parse, it always functions as if we are on index page.