Aggregate or Variable or ClientAction | Performance Evaluate | Mobiel App

Greetings Folks,

I need some suggestions considering performance for the below Scenario in Mobile App.

I have 10 Screens & on each Screen, need a userID from LocalUserEntity [There will be only one record at a time  i.e the one who logged-in.] Now which approach could be best to go with :

1- Using LocalUserEntity Aggregate in all Screen 

or


2- Creating a Common Client Action & returning an Output variable i.e UserID, so that we can use it. But here there's a use-case, As of my entity is Local thus I cannot make the client action as Function & thus I cannot use the same in Expressions on Screen.

 Thus If I have to go with this approach, have to create a local variable in every screen & initialize it before using.


or

3- Let's fetch the UserId any-how via Aggregate /Client Action & then pass to all further screens as an InputVariable.


Do please let me know your suggestions.

Note: I don't want to use Shared-Preferences or Site-Properties

Thanks in Advance.

- Assif

Hi Assif,

To get the User logged-in you need only to consume the built-in GetUserId().  This function will always be accessible for your app.



Regards

Fabio


 

Fábio Fantato wrote:

Hi Assif,

To get the User logged-in you need only to consume the built-in GetUserId().  This function will always be accessible for your app.



Regards

Fabio


 

Hi Fábio Fantato,

Thanks for the reply, 

I forgot to mention it's not the Outsystems User.
It's the Custom one that we are maintaining under a Local-Entity.



Hi assif_tiger

You can also do the same as is done with the regular user. 

Create a session variable, a set function and a get function, and set it on session start making it available throught the get action. 

Br 

Domingues wrote:

Hi assif_tiger

You can also do the same as is done with the regular user. 

Create a session variable, a set function and a get function, and set it on session start making it available throught the get action. 

Br 

Hi Domingues,
It's a Mobile App, So there's NoSession.


Domingues wrote:

You can check this link: 

https://success.outsystems.com/Documentation/10/Developing_an_Application/Use_Data/Maintain_State_while_Navigating_across_Screens

It has a suggested pattern to what you want to achieve 

ya, I have been mentioned the possible approach based on that only i.e Outsystem's way.
- Aggregate or ClientAction or InputVariable's

But I want to know the feasible one on a Performance basis.



I would go with:

1- Using LocalUserEntity Aggregate in all Screen 

You'll never have enought records on that local entity to impact whatsoever 

br