cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

Security level per user

Hey there ! 

I would like to get this to work, I have a gallery  that has data related to the values I entered in a form, then  I need those values to be filtered depending on the areas the user belongs. 

For example I have these 4 areas, but I just need to show data in the gallery for  Area1 and Area4 to the specific User1 

I have this values: 

Area1

Area2

Area3

Area4 

 

Table Users : 

User    Areas 

User1: Area1, Area4 

User2: Area2, Area1, Area4 

User3: Area3,Area1,Area2

 

Thanks in advance for your help. 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Microsoft
Microsoft

Hi @Davidsagi ,

 

Could you tell me:

What’s your data source?

What’s the data type of Areas column in “Users” Table?

Does each record belong to only one area?

 

I assume:

Share Point list is your data source.

Areas column’s data type is single line of text.

Each record belongs to only one area.

 

If my assumptions are correct, I've made a test for your reference:

1\ This is my “Users” table. User and Areas are “single line of text” columns.

v-xiaochen-msft_0-1610519404684.png

 

 

2\ This is my Testdata table. It stores all the data. Area is a “single line of text” column.

v-xiaochen-msft_1-1610519404687.png

 

 

3\ Add a gallery control and set its Items property to:

Filter(Testdata,Area in Split(LookUp(Users,User="User1").Areas,","))

Or

 

Ungroup(ForAll(Split(LookUp(Users,User="User1").Areas,","),Filter(Testdata,Area=Trim(Result))),"Value")

 

 

4\ The result is as follows:

v-xiaochen-msft_2-1610519404688.png

 

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

1 REPLY 1
Microsoft
Microsoft

Hi @Davidsagi ,

 

Could you tell me:

What’s your data source?

What’s the data type of Areas column in “Users” Table?

Does each record belong to only one area?

 

I assume:

Share Point list is your data source.

Areas column’s data type is single line of text.

Each record belongs to only one area.

 

If my assumptions are correct, I've made a test for your reference:

1\ This is my “Users” table. User and Areas are “single line of text” columns.

v-xiaochen-msft_0-1610519404684.png

 

 

2\ This is my Testdata table. It stores all the data. Area is a “single line of text” column.

v-xiaochen-msft_1-1610519404687.png

 

 

3\ Add a gallery control and set its Items property to:

Filter(Testdata,Area in Split(LookUp(Users,User="User1").Areas,","))

Or

 

Ungroup(ForAll(Split(LookUp(Users,User="User1").Areas,","),Filter(Testdata,Area=Trim(Result))),"Value")

 

 

4\ The result is as follows:

v-xiaochen-msft_2-1610519404688.png

 

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Users online (22,120)