cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kosenurm
Super User
Super User

Only allow person from a variable look up to use a toggle

Hi there, 

 

I have a variable OnStart of my app which looks up whether the person using the app is on a Dataverse table. If they are, they can do certain things in my app which others can't. This variable is called "IsPriv"; meaning "Is Privileged". 

 

I want to use this variable to ensure that only those where IsPriv = true, can use a toggle control, otherwise they get a Notify message saying that they don't have permissions. Please can someone advise on the code for this?

 

Many thanks

K.

1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Super User
Super User

In the DisplayMode of the Toggle:

If(IsPriv,DisplayMode.Edit,DisplayMode.View)

 

Then Inside a Label beside or below the Toggle with:

"You cant use a Toggle" in the Text Property.

 

Then set the Visible of the Label to: IsPriv

 

If it doesnt work, show the formula for the Variable.

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Please Subscribe to my Youtube Channel

View solution in original post

2 REPLIES 2
eka24
Super User
Super User

In the DisplayMode of the Toggle:

If(IsPriv,DisplayMode.Edit,DisplayMode.View)

 

Then Inside a Label beside or below the Toggle with:

"You cant use a Toggle" in the Text Property.

 

Then set the Visible of the Label to: IsPriv

 

If it doesnt work, show the formula for the Variable.

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

Please Subscribe to my Youtube Channel

@eka24 

Thanks - this works.

 

When the Privileged user now selects the toggle, a pop up appears with a combobox. When they enter a person into this combobox and hit Submit, it adds the Display Name of the person from the combobox to a variable called "LondonDelPerson". 

 

On my patch command (this is a deskbooking app), a column name is 'LDN Desk Reserved For:'   - I want this to patch the LondonDelPerson's name if the variable is not blank, otherwise patch the user's name (User().FullName).

 

Any ideas?

 

I was trying Text(If(!IsBlank, LondonDelPerson, User().FullName)   but get an error?

 

Thanks

K.

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 (3,358)