cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper III
Helper III

How to display app control from different users

Dear Community team,

 

I have designed small apps which use to display all the information of staff. However, I want full controls app for only particular user only, the rest of user just only view their information. 

 

I have gone through some discussions which is similar to my question, but I won't get those information.

 

Could anyone help to provide detailed information/clue to resolve it? 


Thanks,

Phearin 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @phearin ,

Have you taken a try with the solution I provided above?

Have you solved your problem?

 

If you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

10 REPLIES 10
Anonymous
Not applicable

Hi @phearin,

 

What is your data source ? 

If it is a Sharepoint List, you must concentrate on your List parameters, that permit to allow users only to read and modify their data.

 

List > Parameters > Advanced parameters > Access on reading and on creation

 

Hope it will help you.

 

Regards,

 

Louis

Hi @Anonymous ,

 

It is on sharepoint as data source. 

Let me give you an example of the form:

The form contains Edit, Add button and those button I want it to appear for certain user only. All other users will not see those button.

 

Thanks,

Phearin 

Anonymous
Not applicable

Ooooh sorry I didn't understand!

 

For that, you can use Office365Groups.

You create one group Sharepoint called "PermissionGroup" where you put all users who can see those buttons.

Then on the OnStart statement of the app, you put :

If(
    "PermissionGroup" in Office365Groups.ListOwnedGroupsV2().value.displayName;
    Permission = true
)

Then, on each button, you put that .Visible statement :

Permission

Does it help you ? 🙂

 

Regards

Hi @phearin ,

Do you want to display controls within your app based on specific users?

Could you please share a bit more about the specific/certain users that you mentioned?

 

Based on the needs that you mentioned, I think the Visible property of the control could achieve your needs. I assume that only yourself could see these buttons within your Edit form. I have made a test on my side, please take a try with the following workaround:

Set the Visible property of the specific controls to following:

If(
   User().Email = "Your Email Address",
   true,
   false
)

Or

If(
   User().FullName = "The Display name of your sign in account",
   true,
   false
)

 

In addition, you could also consider save the certain users' display name or email address into a collection within your app. Then you could compare current sign in user's display name or email with the saved collection.

Please set the OnStart property of the App control or the OnVisible property of the first screen of your app to following:

ClearCollect(
CertainUsersEmail,
"User1@email.com",
"User2@email.com",
"User3@email.com"
...
)

Set the Visible property of the specific controls (these buttons you mentioned) to following:

If(
    User().Email in CertainUsersEmail,
    true,
    false
)

Please take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-xida-msft ,

 

Yes, you are right. I want to display screen control for specific users. For the screen below, I want to show that all buttons to specific user, for instance, the Add button. However, if you normal user, then you won't able to see that Add button. 

 

Note: I will try your solution to see whether it works in my case. 

 

2019-05-27 15_58_06-Window.png

Hi @phearin ,

Have you solved your problem?

 

If you have solved your problem, please go ahead to click "Accept as Solution" to identify this threads has been solved.

 

If you have any other questions about PowerApps, please feel free to reply here.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Community Support
Community Support

Hi @phearin ,

Have you taken a try with the solution I provided above?

Have you solved your problem?

 

If you have solved your problem, please go ahead to click "Accept as Solution" to identify this thread has been solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Hi @v-xida-msft ,

 

I have tried your suggestion, but it seems the button has been disappear when I applied:

 

Visible on add button: If(User().Email in CertainUserEmail,true,false)

on App collection onStart: ClearCollect(CertainUserEmail,"abc@xyz.com") 

 

Thanks,

Phearin 

Hi @v-xida-msft ,

 

It is working fine with your solution in my case. 

It just need understanding the sensitive case of the function.

 

I have tried this function: If(User().Email = "prey.veng@abc.com", true,false) , it will not work. Unless you use case sensitive with your email. If(User().Email= "Prey.Veng@abc.com",true,false) then it is working in that way.

 

Thanks,

Phearin 

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!

Top Solution Authors
Top Kudoed Authors
Users online (70,270)