138
Views
2
Comments
Solved
Passing varibles to other modules
Question

I want to pass a username but i dont want it to be shown in the url. I know i can use the get userID form outsytems functions, but in this case i'am using my own database of user.  The login page is in the different module from the main page. So currently i could do the login but i cant get the username that logged in. Is there a way to pass the username to the main page module without showing it in the url ? Thank you 

2018-10-29 08-31-03
João Marques
 
MVP
Solution

Hi Raven,


There are a few ways to do that. You need to store that data and retrieve it, the question is where:

  • Client variable - better for performance, it's the perfect place to keep small pieces of non-confidential information. You can have a public client action in the module of the client variable to be consumed on the modules where you are going to need to display it;
  • Database - this means you will need to retrieve the information via a query

Given the use case, I would go for the client variable possibility, which is actually what OutSystems does by default when you create a Reactive Web App module, like you can see in the image below:


Just create a public client action that returns the client variable name and you will be able to use it on screens from other modules.


Kind Regards,
João

2026-01-03 13-44-38
Erwin van Rijsewijk
Champion

NEVER expose a username or userid ;-)

In the other module just call User_GetName and it will return the name of the loged on user.

2018-10-29 08-31-03
João Marques
 
MVP
Solution

Hi Raven,


There are a few ways to do that. You need to store that data and retrieve it, the question is where:

  • Client variable - better for performance, it's the perfect place to keep small pieces of non-confidential information. You can have a public client action in the module of the client variable to be consumed on the modules where you are going to need to display it;
  • Database - this means you will need to retrieve the information via a query

Given the use case, I would go for the client variable possibility, which is actually what OutSystems does by default when you create a Reactive Web App module, like you can see in the image below:


Just create a public client action that returns the client variable name and you will be able to use it on screens from other modules.


Kind Regards,
João

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