106
Views
4
Comments
Hide URL Parameters with JavaScript
Application Type
Reactive

Hi , folks ! :)

I need to hide the input parameters of some screens in my system, and I used the JS code below, in the OnInitialize of the screen, however, when I refresh the screen, the information on the screen that depends on these parameters, for example expressions, is erased... could you help me so that I can solve this in the best way? Thanks :)


var uri = window.location.toString();

if (uri.indexOf("?") > 0) {

    var clean_uri = uri.substring(0, uri.indexOf("?"));

    window.history.replaceState({}, document.title, clean_uri);

}

2024-04-05 11-04-57
Krishnnambal
 
MVP

Hi,


Instead of using input parameters, you can use client variables to pass a value from one screen to another. This way you won't need custom javascript and can be achieved easily. Go for this approach if this hiding is only an aesthetic concern.

2024-04-05 11-04-57
Krishnnambal
 
MVP

Inputs passed via client variables would not show up on the URL but would be accessible to the other screen.

2022-01-24 13-22-23
Vaibhav Patidar

Hi @Gustavo Mor ,

There are more simplified way to achieve this. Please refer to below post. 

https://www.outsystems.com/forums/discussion/71831/encrypting-input-parameters-in-url-of-details-screen-in-reactive-app/

Hope it helps.

Thanks

2024-07-05 14-16-55
Daniël Kuhlmann
 
MVP

Hi,

Please read this article from MVP Justin James, for better understanding:
https://jmjames.medium.com/hiding-ids-in-outsystems-urls-7eea5b5c9ed7

-- Daniel

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.