filtering of data based on users

Hi All,

I am developing one application which has a form in it, in which few text field will have some predefined data which was filled by the user early or from the excel (bootstrapped the DB entity).

Now I want to filter and have the default data value for the fields based on the user role only( if the user with the same role has logged in then only the data should be visible else the text field should be empty for the user to fill manually). But I am not understanding how it can be achieved. 

I have already created the Roles for the users.

Thank you  

Ankita k wrote:

Hi All,

I am developing one application which has a form in it, in which few text field will have some predefined data which was filled by the user early or from the excel (bootstrapped the DB entity).

Now I want to filter and have the default data value for the fields based on the user role only( if the user with the same role has logged in then only the data should be visible else the text field should be empty for the user to fill manually). But I am not understanding how it can be achieved. 

I have already created the Roles for the users.

Thank you  

Hi Ankita,

If I understand your case correctly you'd like to have a form where depending on the user role certain fields are already filled with default data?

Also is the app you're developing a traditional web app, a reactive web app or a mobile app?

Kind regards,

Glenn


glenn michiels wrote:

Ankita k wrote:

Hi All,

I am developing one application which has a form in it, in which few text field will have some predefined data which was filled by the user early or from the excel (bootstrapped the DB entity).

Now I want to filter and have the default data value for the fields based on the user role only( if the user with the same role has logged in then only the data should be visible else the text field should be empty for the user to fill manually). But I am not understanding how it can be achieved. 

I have already created the Roles for the users.

Thank you  

Hi Ankita,

If I understand your case correctly you'd like to have a form where depending on the user role certain fields are already filled with default data?

Also is the app you're developing a traditional web app, a reactive web app or a mobile app?

Kind regards,

Glenn


Hi Glenn,

1) Form and all the field in the form will be same for all the users, but default data in the field should differ based on roles. For ex: if user has logged in with role A , Name field should have "A". If user has logged in with role B, one same Name filed should have "B". And also this field should be editable as well.

2)  I am creating it in traditional web.



Hi,

You have check role functions (https://success.outsystems.com/Documentation/11/Reference/OutSystems_Language/Logic/Built-in_Functions/Roles), but you have to have the default values stored somewhere or only in the If condition.

Hope it helps,


Hi Ankita,

In attachment you'll find a small example of how it can be done.
As Nelio said you'll have to either get the default values from somewhere or have them hard-coded in your code.

Kind regards,
Glenn