Urlparams.publickey does not change after calling utils.openApp

I am trying to reload an app with a different querystring like so:

await utils.openApp('707fa*********************f416', {queryParams: {publickey: selContractors.selectedItem.publickey}})
await qryTasksSelect_JSON.trigger()

This changes the value of publickey in the query string, but it does not reload the page and urlparams.publickey does not change. qryTasksSelect_JSON uses urlparams.publickey to filter the appropriate database records, but nothing happens.

This may be related to: utils.openApp not triggering queries on query parameter change

This works fine as an alternative:

utils.openUrl("https://captiontracker.retool.com/editor/707********0faab004f416/IC_Home_Modals?publickey=" + selContractors.selectedItem.publickey, {newTab: false})

I just would have expected openApp to also work, and maybe without actually reloading.

Hi @bradlymathews Thanks for reaching out! I'm glad you have an alternative solution :slightly_smiling_face:

We have an internal request to fix this behavior to match the openURL behavior. We also have a request for a programmatic way to 'reset app state', which would also work around this issue (you could call it after the open app event). I can let you know here if either of these ship.

If it works for your use case, you can use hashParams instead of queryParams, and it would update as expected after running await utils.openApp('707fa... since hash params update without needing to reload the page.

Thanks.

Hash params sometime also work, but in this case we needed URL Params because of another quirk. If you move between Dev (IDE) view and user view, the hashes disappear, making testing a little more work. The query strings do not disappear.

Of course, query strings cannot link to component properties so you are left deciding what is most important to you in a conflict.

1 Like