Skip to Content (Press Enter)
OutSystems.com
Personal Edition
Community
Support
Training
Training
Online Training
Developer Schools
Boot Camps
Certifications
Tech Talks
Documentation
Documentation
Overview
ODC
O11
Forums
Forge
Get Involved
Get Involved
Jobs
Ideas
Members
Mentorship
User Groups
Platform
Platform
ODC
O11
Search in OutSystems
Log in
Get Started
Back to Forums
Nouman Mirza
2
Views
4
Comments
Filter query results based on user information
Question
I am trying to filter table results based on specific information a user has entered.
I have user enter 5 zipcodes under 5 different attributes in the User_Master entity. I have created a table that will display differenty address based on the zipcodes in the attributes. The query is running the search and displaying the information as requested with one small error. The table will display results from all users in the system.
For example:
User #1 inputs 22191, 22192, 22193, 22194, 22195
User #2 inputs 22025, 22026, 22027, 22028, 22029
The result should be that User #1 should only see addresses based on those zip codes but right now user #1 sees information for himself and user #2. I know I need to tell the query to only filter the data for the logged in user but can't figure out how to do so. Hopefully someone can point me in the right direction.
Paulo Tavares
Staff
Hi Nourman, and welcome to the OutSystems community forums.
If I understood your problem correctly, you need to create an input parameter for the query of User Identifier data type (for example, name it "CurrentUserId").
You need to pass it Session.UserId, and then add a condition stating "USER_MASTER.Id = CurrentUserId".
Will that do the trick?
Regards,
Paulo Tavares
Miguel Antunes
Hi Nourman,
to get only the results from the logged user you should add an Input Parameter in your query and use the action
Login_GetUserMasterId
().
For more information check this
https://www.outsystems.com/NetworkForums/ViewTopic.aspx?Topic=user-and-user_master---users-and-access-control-faq
regards,
Miguel Antunes
Nouman Mirza
Thank you Paulo & Miguel. Both of your suggestions worked flawlessly. I knew it was a simple thing but just couldn't exactly put my finger on it. Thanks again for your quick help and response!
Paulo Tavares
Staff
Hi Nourman,
By all means, we're glad to help.
Let us know how it goes, and if something else comes up!
Regards,
Paulo Tavares
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting.
See the full guidelines
Loading...