cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Bob_Yang0030
Regular Visitor

How to use Edit Icon only let the designated person modify DataCardValue

Hello

 

How to use Edit Icon only let the designated person modify DataCardValue?

Bob_Yang0030_1-1660116605778.pngBob_Yang0030_2-1660116651052.png

I just want the edit icon that only my or other assgin user can make modifications in other DataCardValue.

 

thanks,

Bob

 

7 REPLIES 7
fratrucc
Helper I
Helper I

@Bob_Yang0030 

For this kind of stuff i usually put in the "Onstart" property of the App a variable where i store with the office365 connector data of the current User (example "varUserProfile").

After that i compare one of the data that I got (most of the time I go for the e-mail comparison) with the e-mail of the people that got the permissions to use it and i store the true/false in another variable (for example  "varAdminPermission").

After that I apply to the visible properties of the items where you need permission, you just need to put the "varAdminPermission" and if it's true they can see it.

 

So:

1-Check current User profile data and store it (varUserProfile)

2-Compare something like varUserProfile.Maill with e-mail that you chose and store in a variable true/false (varAdminPermission)

3-Set the visibile properties of the items: varAdminPermission

 

Hope it helps,

Francesco

Bob_Yang0030
Regular Visitor

I tried to use :

Onvisible Set(varUserProfile,false);Set(varAdminPermission,true)

 

the command It's not implemented. It's still available for anyone to edit.

 

thanks

Bob

 

fratrucc
Helper I
Helper I

@Bob_Yang0030 

I mean, of course it's available for anyone, becouse with this formula you set only 2 variables without any condition.

If you were following what i said in the last comment, you need to work in "Visible" property of every single item that you want to manage with the Admin permission, and you don't need to set the variable another time, you can just go with the name of the variable, that will put Visible=true or visible=false, based on the first comparison that you already done on the "OnStart" of the app.

 

Francesco

fratrucc
Helper I
Helper I

@Bob_Yang0030 

I guess you need an example, try like this, that's the code.

The only thing you need to do before is add in the data section the Office 365 connector, so you can take office 365 data.

 

App - OnStart

Set(varUserProfile, Office365Users.MyProfile());
//After write the first set run the on start of the app, or set it for the first time with a button, you need it to see the ".Mail" after the variable name the next step
If(varUserProfile.Mail = "youremail@xxxxx.xx", Set(varAdminPermission, true));

Random Icon - Visible

varAdminPermission

 

 

Bob_Yang0030
Regular Visitor

@fratrucc 

 

it's not working,  other people can modify edit Icon. 

Bob_Yang0030_0-1660292216721.png

Bob_Yang0030_1-1660292935552.png

thanks

fratrucc
Helper I
Helper I

@Bob_Yang0030 wait, you are trying to use it in edit mode, and i guess you put the Admin permission on you. I mean, while writing the code for you i tryed it and was working. Just put a random e-mail in the app start and run it another time, and watch if you can see the icon. The best way it's try to use the app normally with 2 account, one with permission and one no. So you can check if they can use the icon.

 

If you want to stop people modify the app it's another thing and I guess the only way here is to manage the app permission outside. If i have access to the edit mode of the app i can change what i want, there is no way to stop it I suppose.

fratrucc
Helper I
Helper I

@Bob_Yang0030 When you share the app you can chose 2 role.

User or Co-owner. user can only use the app, Co-Owner can change all (the only limitation i think is that he can't delete the App).

 

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Users online (4,673)