How do I run 'Fetch Collection' through Javascript?

I have a javascript element i’m running for importing data, after I complete import I’d like to fetch the collection to show the new data. How can I run ‘Fetch Collection’ through javascript?

Weweb team recently added a way to trigger workflows from javascript: wwLib.executeWorkflow(workflowUID). You can use this to trigger a global workflow and fetch the collection with that workflow.
You can see an example of use here and here.


@dorilama Isn’t there a way to just fetch the collection without having to set up a dedicated workflow?

hi @unlustucru,
use the following code