Missing Util: "setUrlParameters"

I'm not sure why, but while the utils.setUrlParameters utility is supported as an event handler through the GUI, it doesn't seem to be accessible in scripts.

Interestingly, the function specification does appear in the GUI whenever it's used, but when trying to call this utility from a script, it simply doesn’t exist.

Could you clarify why this is the case? Or is there any documentation that might help me use this method directly?

This utility is quite useful for cross-app referencing, especially when reloading the app while ensuring certain variables retain their initial values.

P.s. Added the infamous bug tag, because it seems inconsistent to me.

The main reason this concerns me, is there are times when you're depending on scripts for certain behavior. For instance, when using the app shortcuts, all you can do is use scripts, since there are no event handlers.

In general, using code/scripts can significantly leverage a more Don't-Repeat-Yourself (DRY) workflow.

Finally, I realize there is a openUrl , or openApp, but these act differently and cause the app to reload, or at least parts of it.

Hey @emozio! This looks like an issue with the linter, as the method does exist and functions as expected.

I'll let the team know and provide an update here as soon as there is news to share!

1 Like

Thanks for providing an example, because that's one of the things I wanted to ask: how can I use this regardless of the linter. :wink: I guess it's also not mentioned in the docs, as far as I can tell. Something worth considering.

Actually, does this apply to hash or query params?

1 Like

The snippet that I shared will set query params! There's probably a way to do hash params, as well, but I'm not sure of the syntax.

Any idea how that's done? That was supposed to be my original question. :wink:

Ah got it - you can use the following as a good reference. The first argument is an array of query parameters and the second is an array of hash parameters.

We should hopefully have a fix for exposing the method to the linter soon!

This fix is live for all Cloud instances as of version 3.182.0. :+1: