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

Reset Toggle and change view to hidden?

Is it possible to set a Toggle to reset and then change the view to hidden after the reset?

 

I have a form that once the user has toggled the question to true I want that toggle to reset to false and then to become hidden.

 

Thanks for any help,

12 REPLIES 12
Drrickryp
Super User II
Super User II

@J0hn 

Please clarify, do you want to submit the form once the toggle is selected?  Do you want to hide the toggle or the form it's on?  Do you want the toggle hidden if the question is answered as "true"?

@Drrickryp 

Yes, I would like the form to submit and then reset to false and the toggle to no longer be visible. Currently the form is setup that on toggle to true it writes the current date and time to an excel table. What I want is once this has been completed I want the toggle to reset to false so the next time the user goes into this form it does not update the excel field again because its been changed back to false. and then if the toggle is no longer visible they cannot re toggle it to true.

Drrickryp
Super User II
Super User II

@J0hn 

If you set the visible property of the toggle to 

IsBlank(Parent.Default)

and the Reset property can stay false.  Then, if there is no information for that answer, the toggle will be visible (like when the form is in New mode). It will also be visible if the user has submitted the form but hasn't answered the question and then goes back to answer it.  However, once the user has answered the question, Parent.Default will not be blank so the toggle will be hidden.   

@Drrickryp  This would work but unfortunately the form is never new they will go back into the form multiple times until all toggles have been checked. Is there a way to do this when editing the form?

 

Thanks for all your help,

@J0hn 

Are you saying that you want the toggle disabled on change even before the data is saved to Excel?  The solution I suggested will not allow the User to change the toggle once the question is answered and the form has been saved, no matter how many times the user may return to it. 

@Drrickryp 

Your solution only works if the form is starting as a new form off the start. In my case the form has already been created for each month of the year so the user is going in and switching toggles to true through out the month till completed. Every time they toggle to true and click save this updates the excel sheet.

 

When the user goes back into the form anything that is toggled to yes updates again on the excel sheet which is what I dont want. So my thought where to reset the toggle after the user clicks save and the next time they go into the form it would be disabled/hidden so they didnt hit the toggle again.

 

Perhaps is there a way in my current formula that on check if the toggle is already true do nothing but if false and then switched to true update the excel sheet? Below is the current formula on check.

 

If(DataCardValue1.Value=true,Patch(Table1,LookUp(Table1,Month=DataCardValue2.Text),{'Monthly Defibrillator Inspection Completed?':Now()}))

Drrickryp
Super User II
Super User II

@J0hn 

Thanks for the info! It really helps to have more context to understand how you can accomplish your goal.  Could you post a screenshot of the one with the form on it.  

Hi @J0hn 

I think I got it.  See if this works for you.  The relevant formulas are shown in red

The toggle is only visible when the Parent.Default of the card is blank.

The textinputbox inside the card is DisplayMode.View and the Default of the textinputbox will fit one of three conditions. 

  1. If the Parent.Default is blank and the toggle is false, the default is blank.
  2. If the Parent.Default is blank and the toggle is true, the default is Now()
  3. If the Parent.Default is not blank, then it is Parent.Default.  The gallery is shown on the right side.


1.png2.png

_3.png

Here is a screenshot of the Excel spreadsheet for this example._1.png

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,442)