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 Platform Community / Forums / Power Apps / Row level security in ...
Power Apps
Answered

Row level security in Powerapps based on group

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I have a Powerapp in which users enter daily rates based on the group. 

 

The main thing here is each individual enters the rate representing a group. For example, i have 5 groups in which each group has 10 members. A random member of a group enters data daily. I want users to see only their group data. This Power \app doesn't capture user level detail like who entered the data but it takes data as a group.

 

Please let me know if there is any way to solve this challenge.

 

Thanks,

Nisar

powerapp doubt.PNG
Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    156,425 Most Valuable Professional on at

    Hi @Anonymous ,

    You need a reference list with the user's email address and the group they belong to.

    Then at App OnStart do this

    Set(
     vUserMail,
     User().Email
    );
    Set(
     vUserGroup,
     Lookup(
     YourRefListName,
     UserEmailField=vUserMail,
     Group
     )
    )

    Then your Gallery Items would be something like

    Filter(
     YourListName,
     Group=vUserGroup
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz 

     

    Thanks for your reply. 

     

    The datasource which i have is sharepoint list where in i don't have user's email address in it. Do you mean i need to create another sharepoint list with user's email address and the group they belong to. But after i create it, will the powerapp accept 2 sharepoint list as datasource and will it not affect the formulas? 

     

    Thanks,

    Nisar

  • WarrenBelz Profile Picture
    156,425 Most Valuable Professional on at

    Hi @Anonymous ,

    I have an app with over 30 SharePoint lists as data sources, so two will work well.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @WarrenBelz  Thanks for the clarification.

     

    I am new to this powerapps, i find this kind of confusing.

     

    I have created another sharepoint list with email address & group. Just wanted know how do we create relationship between 2 lists. 

    i mean i have date, group, sub group, productivity, adjustment in one sharepoint list and email address & group in another sharepoint list. Before to apply formula is there any step i need to follow or can you please provide me the formula with the columns which i specified.

     

    Appreciate your help.

     

    Thanks,

    Nisar

  • WarrenBelz Profile Picture
    156,425 Most Valuable Professional on at

    Hi @Anonymous ,

    I must have missed your post.

    You can reference any connected list in LookUps. I see you have the Group as the common value. What are you wanting to reference and how?

  • WarrenBelz Profile Picture
    156,425 Most Valuable Professional on at

    Hi @Anonymous ,

    Just checking if you got the result you were looking for on this thread. Happy to help further if not.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @WarrenBelz 

     

    Thank you so much for helping me by providing the code. I Still can't get RLS up & running after using the code. Also i have been using filter function in the form to filter data based on search box (using filter instead of search because "search" can't be used in choice data type from SharePoint.

     

    Please find the code below and kindly let me know if i am making any mistake.

     

    On start: 

    Set(
    vUserMail,
    User().Email
    );
    Set(
    vUserGroup,
    LookUp(
    'Plant Ops_RLS test',
    'E-mail address'=vUserMail,
    Group
    )
    )

     

    I am using datatable in the form so implementing the same there 

    Items:

    Filter('Plant Ops_Nisar',StartsWith(Group.Value,searchbox_MS_4.Text) || StartsWith(Plant.Value,searchbox_MS_4.Text) || EndsWith(Plant.Value,searchbox_MS_4.Text) || StartsWith('Cost Type'.Value,searchbox_MS_4.Text) || EndsWith('Cost Type'.Value,searchbox_MS_4.Text)|| searchbox_MS_4.Text in 'Calendar Date' && Group.Value=vUserGroup )

     

    Thanks,

    Nisar

    doubt.PNG
  • Verified answer
    WarrenBelz Profile Picture
    156,425 Most Valuable Professional on at

    Hi @Anonymous ,

    I am not sure why you are using StartsWith and EndWith and also if you have a date in Calandar Date (in which case there will be an issue with the below.

    Filter(
     'Plant Ops_Nisar',
     (
     searchbox_MS_4.Text in Group.Value || 
     searchbox_MS_4.Text in Plant.Value || 
     searchbox_MS_4.Text in 'CostType'.Value || 
     searchbox_MS_4.Text in 'Calendar Date' 
     )&& 
     Group.Value=vUserGroup
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @WarrenBelz  You're the best. You knocked me off my feet!.

     

    Thank you so much for helping me with the code also to correct the existing code. 

     

    The code works the way we wanted. I appreciate it.

     

    Thanks,

    Nisar

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard