web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

Row level Security

(0) ShareShare
ReportReport
Posted on by 4

Hello,

I have created an App with Data table to view the data and a form to enter values by the users. Data table populates data base done SQL table. But, I want to restrict the users to view the data in the table based on the Email and codes assigned to the email from another SQL table. I tried creating global variable with collection and filtering, but seems to be not working. Any ideas are much appreciated

Categories:
  • WiZey Profile Picture
    3,023 Moderator on at

    Hello,

     

    Could you share what and how you've done it, so we can better point the issues and help you fix them?

     

    Also, if you simply want to check if user's email is attached to a certain code in your table, you can use this:

     

    Set(
     glbVariable,
     IsBlank(
     LookUp(
     source,
     And(email = User().Email, code = "value")
     )
     )
    )

     

    Here, "glbVariable" will be set to "TRUE" if no record were found for the provided email and code.

  • PRamashe Profile Picture
    4 on at

    Hi Wizey,

     

    Thanks for the response. I think, I missed some part of my question. Users in the RepCodes table, should be restricted to their respective codes,  but rest of the users(may be called Super Users) should see all data from the Data Table. 

    I was trying to filter the  SQL table 1,  looking up RepCodes  based on Email ( from SQL table 2) on the items property or Screen -Visible property of the Data table, but it wasn't working as the Data table already has a filter based on the dropdown values.  Now, I created a collection, with adding Email column from the Table 2 to the SQL table 1 and filtering the collection with a Match value of the Email, but not sure if this the right approach. 

     

    So, the global variable will just restrict the users to their respective codes. Right? Can the superusers see all data based on this global variable?. Let me know more info needed from my end.

  • WiZey Profile Picture
    3,023 Moderator on at

    If I got this right:

     

    • Table2 has email and code
    • Table1 has record and code
    • You want to display only if Table1.code = Table2.code while Table2.email = User.email

     

    If so, I believe you can do it in two steps.

     

    1. In "OnVisible", "UpdateContext()" a local variable to store all the codes from Table2 attached to "User().Email"
    2. In your gallery's "Items", "Filter()" on the codes using "in" operator.

     

     

     

    Filter(
     source,
     Or(code in lclVariable, isEmpty(lclVariable))
    )

     

     

     

    Did I get this right? Can you make it work this way?

  • PRamashe Profile Picture
    4 on at

    Hi WiZey, 

     

    You got me right. I will apply this filter and update you on this.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 432 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 347

#3
WarrenBelz Profile Picture

WarrenBelz 254 Most Valuable Professional

Last 30 days Overall leaderboard