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

Disable Toggle once submitted.

Snap.PNGHi Powerappers,

 

Question...

 

How do i disable the toggle button after i have submitted my form and i return to that screen?

 

 

 

Display = If(Toggle2=true, DisplayMode.Disabled, DisplayMode.Edit)

 

 
 
2 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Community Champion
Community Champion

Re: Disable Toggle once submitted.

Hi @BennyCruger ,

Do you mean when it is set to true or when you return to the screen. 

DisableToggle.gif

 

 

 

 

If you want to do it straight away, put this code (replace with your name) on the DisplayMode of the toggle itself

If(
   YourToggleName.Value=true,
   DisplayMode.Disabled,
   DisplayMode.Edit
)

If you want it afterwards, let me know as this is a bit more involved.

 

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.

View solution in original post

Highlighted
Community Champion
Community Champion

Re: Disable Toggle once submitted.

OK @BennyCruger ,

You need a variable here to trigger it - I will use vDisable - call it whatever you want.

On the DisplayMode of the toggle

If(
   vDisable && YourToggleName.Value=true,
   DisplayMode.Disabled,
   DisplayMode.Edit
)

On the OnVisible of the Screen

UpdateContext({vDisable:YourToggleName.Value})

This sets the Variable to the current value of the toggle - so if the toggle is true, it will immediately disable. If it is false, it will stay enabled. When you set the toggle the first time, vDisable will be false, so it can stay enabled until the screen is reentered.

 

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.

View solution in original post

5 REPLIES 5
Highlighted
Community Champion
Community Champion

Re: Disable Toggle once submitted.

Hi @BennyCruger ,

Do you mean when it is set to true or when you return to the screen. 

DisableToggle.gif

 

 

 

 

If you want to do it straight away, put this code (replace with your name) on the DisplayMode of the toggle itself

If(
   YourToggleName.Value=true,
   DisplayMode.Disabled,
   DisplayMode.Edit
)

If you want it afterwards, let me know as this is a bit more involved.

 

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.

View solution in original post

Highlighted
Regular Visitor

Re: Disable Toggle once submitted.

Thanks i forgot the .value.....

Highlighted
Regular Visitor

Re: Disable Toggle once submitted.

@WarrenBelz 

 

Could you give it to me after the submit has happened?

Highlighted
Community Champion
Community Champion

Re: Disable Toggle once submitted.

OK @BennyCruger ,

You need a variable here to trigger it - I will use vDisable - call it whatever you want.

On the DisplayMode of the toggle

If(
   vDisable && YourToggleName.Value=true,
   DisplayMode.Disabled,
   DisplayMode.Edit
)

On the OnVisible of the Screen

UpdateContext({vDisable:YourToggleName.Value})

This sets the Variable to the current value of the toggle - so if the toggle is true, it will immediately disable. If it is false, it will stay enabled. When you set the toggle the first time, vDisable will be false, so it can stay enabled until the screen is reentered.

 

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.

View solution in original post

Highlighted
Regular Visitor

Re: Disable Toggle once submitted.

@WarrenBelz 

 

Thanks a million Warren!!

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,751)