Hi,

     While navigating from list screen to detail screen how to encode url parameters.

Thanks,

R.karthik


Hello,


You can try to use session variables or encrypt mechanism. You can see a lot of options on Forge:

https://www.outsystems.com/forge/list?q=crypto

I hope it helps you.


BR,

Luis

If you want to hide the parameter for security purpose then you can use Luis's suggestion. But if your concern is not hiding the parameter but to encode the parameter so that it doesn't break your URL then you can follow below approach

Call server action on link click and pass your input parameter there. use URLEncode server action from HTTPRequestHandler extension to encode your parameter and use destination node to redirect to your detail screen with encoded parameter.

R.kar wrote:

Hi,

     While navigating from list screen to detail screen how to encode url parameters.

Thanks,

R.karthik


Hi R.kar talking about best practices you can use the session variables to hide these URL parameters.

But you can use: Session Variables, change the method from navigate to submit, urlEncode(), CriptoAPI component, etc

I found this post that has a good explanations and ways to do it, so I will not even try to explain cuz the answer is here

Also found an article from Justin James that also explain the option

Hope I could help you

Best regards

Carlos Lessa

Please don't do this with session variables!

If you open two links in differents tabs and for some reason refresh the first, it will open the same link as the second.


There are several possible questions, each with different solutions.

To encode (allow special characters in the URL) do like Hugo and Nikhil said.

To hide the value and make the address cleaner and not reusable (but still refreshable) use POST like in Justin's article that Carlos shared.

To make the Id less tempting to changes, use a GUID (again, like in the article) or Crypto functions like Luis said.

If you want a temporary ID, you can create a table that matches a pair GUID+User with an Id and clear those values every x minutes.

To prevent users from seeing details there are not supposed to, check UserId and Role in preparation. This is compatible will all previous options.


Nuno Reis wrote:

Please don't do this with session variables!

If you open two links in differents tabs and for some reason refresh the first, it will open the same link as the second.


There are several possible questions, each with different solutions.

To encode (allow special characters in the URL) do like Hugo and Nikhil said.

To hide the value and make the address cleaner and not reusable (but still refreshable) use POST like in Justin's article that Carlos shared.

To make the Id less tempting to changes, use a GUID (again, like in the article) or Crypto functions like Luis said.

If you want a temporary ID, you can create a table that matches a pair GUID+User with an Id and clear those values every x minutes.

To prevent users from seeing details there are not supposed to, check UserId and Role in preparation. This is compatible will all previous options.


But you can use session variable and clean the value after use its values, not mean that when using it you must use and forget about it and leave the value there, remember that you are using it to go from one screen to another.

I'm  forgetting something here Nuno?


The issue is not clearing the value. A plain text doesn't take that much space.


Because the question is regarding going from list to detail, I have to assume there are several similar links that can be clicked.

Each time you click a link, a new value is set the same Session Variable. If you happen to refresh the first page, it will read from the same variable as before (pages can't keep values on refresh besides inputs). If the variable was used for other pages, it will read the wrong id and load the wrong info and trick the user.


Also, as a user, I don't like to see a link that is a function (I like to open several at once in other tabs).


Session Variable is a simple solution for pages in sequence, or to toggle webblocks. But not for list/detail navigation.

Nuno Reis wrote:

The issue is not clearing the value. A plain text doesn't take that much space.


Because the question is regarding going from list to detail, I have to assume there are several similar links that can be clicked.

Each time you click a link, a new value is set the same Session Variable. If you happen to refresh the first page, it will read from the same variable as before (pages can't keep values on refresh besides inputs). If the variable was used for other pages, it will read the wrong id and load the wrong info and trick the user.


Also, as a user, I don't like to see a link that is a function (I like to open several at once in other tabs).


Session Variable is a simple solution for pages in sequence, or to toggle webblocks. But not for list/detail navigation.

This is very strange cuz I have very similar question on the Professional and in the Expert certification about hiding and stop a user to modify the URL and the correct answer was to use the session variable to achieve that 


It prevents the user from modifying, but also prevents from refreshing if in-between the user opened another link.

It all depends on the context.