Open Page with URL Param using wwLib.goTo(...)

I need to open a weweb page using a Custom Javascript action in a workflow. That page has a URL Parameter in its url: https://yourdomain.com/app/inventory/11

This helpful thread demonstrated how to use wwLib.goTo(...) with a query parameter:
wwLib.goTo('your_page_uuid', {your_query_name:'your query value'})

That thread was written last July, well before URL params were introduced to WeWeb.

I’ve tried to follow the same pattern for URL params, but when I run the same action, WeWeb opens the correct page with the default param value (11 in the screenshot above)

const page_id = formulas.get_page_id(...); // custom formula, not relevant
//page_id = 'f339bb1f-c26a-4539-a4ff-49ee1d678bae'
wwLib.goTo(page_id, {"id":11})

I’ve tried a number of variations, too.

// URL Param as a string
wwLib.goTo(page_id, {"id":"11"})
// array of URL Params 
wwLib.goTo(page_id, [{"id":"11"}])

What’s the correct way to do this?

I tried mirroring the URL structure in the editor i.e. wwParam-id=12
the function call looks like wwLib.goTo(page_id, {"wwParam-id":12})

That seems to have worked, at least within the editor.

1 Like

@aurelie can you clarify if URL Parameters are compatible with wwLib.goTo?