cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
trbleile
Level: Powered On

Reset all value controls in a multi page survey after the survey is completed/failed

Hello, and sorry for the long story...

 

I have an app which allows users to take an survey. This survey is multi page questionaire with different types of controls (Radio Buttons, Drop Downs, Text Inputs, Check Boxes).

 

This survey spans across 4 different pages and can be failed out on any of the 4 pages. Example: a certain answer on page 1, 2 or 3 will fail out the inspection and the user will not be required to finish the rest of the survey.

 

I have been trying to figure out for awhile how I can be able to reset the entire survey whenever it is either finished or failed but have not been able to figure out an easy solution, as data currently is being written to a DB only once the survey is completed/failed. Setting it on a button press is tough because it resets the values before the data gets patched to the db, as well as I would only want the survey to be reset once the button was pressed AND the survey was finished completely or failed out early.

 

I couldn't figure out a way to leverage UpdateContext either, as it only sees the within the context of the current screen.

My goal is to somehow create a reset variable which will reset the survey when it is completed or failed out on any page of the survey. If you need any more information/Screenshots of what I am trying to do please let me know and I will be glad to provide it.

 

Your help is appreciated.

 

1 ACCEPTED SOLUTION

Accepted Solutions
PowerApps Staff rgruian
PowerApps Staff

Re: Reset all value controls in a multi page survey after the survey is completed/failed

There are multiple ways to accomplish this. Here's one:

 

Whenever you are ready to reset everything (for example after patching, on a Reset button press, etc):

    Collect(Signal, 0); Clear(Signal)

 

(it may be tempting to use ClearCollect in this case. Do not. It has different semantics and will not trigger the dataflow "pulse" you need for reset purposes) 

 

Bind the Reset properties of the relevant text input controls, etc, to:

   TextInput1.Reset = IsEmpty(Signal)

 

Basically "IsEmpty(Signal)" will be your cue that a reset is in order. This can be used in formulas throughout your app to detect and act on "reset signals".

 

I hope this helps!

 

Radu Gruian [MSFT] ** PowerApps Staff

View solution in original post

11 REPLIES 11
PowerApps Staff rgruian
PowerApps Staff

Re: Reset all value controls in a multi page survey after the survey is completed/failed

There are multiple ways to accomplish this. Here's one:

 

Whenever you are ready to reset everything (for example after patching, on a Reset button press, etc):

    Collect(Signal, 0); Clear(Signal)

 

(it may be tempting to use ClearCollect in this case. Do not. It has different semantics and will not trigger the dataflow "pulse" you need for reset purposes) 

 

Bind the Reset properties of the relevant text input controls, etc, to:

   TextInput1.Reset = IsEmpty(Signal)

 

Basically "IsEmpty(Signal)" will be your cue that a reset is in order. This can be used in formulas throughout your app to detect and act on "reset signals".

 

I hope this helps!

 

Radu Gruian [MSFT] ** PowerApps Staff

View solution in original post

trbleile
Level: Powered On

Re: Reset all value controls in a multi page survey after the survey is completed/failed

rgruian's method is working 100% of the time within the powerapps development app on my PC when I test it. But when I try on a mobile device is does not work as intended. Some of the values are not resetting, it seems that only the values on the last page of the survey (if the user gets to it) reset when using a mobile device.

 

It's weird that the app on a device is not acting the same as within Powerapps development, has anyone else noticed this?

 

 

 

PowerApps Staff rgruian
PowerApps Staff

Re: Reset all value controls in a multi page survey after the survey is completed/failed

We are investigating, and will keep you posted.

Radu Gruian [MSFT] ** PowerApps Staff
trbleile
Level: Powered On

Re: Reset all value controls in a multi page survey after the survey is completed/failed

Thanks! Let me know what you find out!

dansshin
Level: Powered On

Re: Reset all value controls in a multi page survey after the survey is completed/failed

Any update on this? It looks like this is still not working in mobile. What other approaches are there to reset all controls?

dansshin
Level: Powered On

Re: Reset all value controls in a multi page survey after the survey is completed/failed

I was able to get this working by using:

 

Collect(signal,{val:0});Clear(signal)

trbleile
Level: Powered On

Re: Reset all value controls in a multi page survey after the survey is completed/failed

Hey Dansshin,

 

This is origninally the method I used to reset the values in the survey pages but unfortunately it was not working as intended on a mobile device. Out of the 4 pages in the survey the only page I could get to reset using this method was the page that the survey actually ended on and while leaving the rest of the pages un-reset. 

 

I've since moved our entire survey to a one page layout. Our customers enjoy this layout much more than the multi-page survey anyway, so we stuck with it - and have no problem getting it to reset!

 

 

Travis 

dansshin
Level: Powered On

Re: Reset all value controls in a multi page survey after the survey is completed/failed

Thanks Travis for sharing the information.

 

For not above seems to work for me how ever when I share the PowerApps with my user they are not able to access the data which is on OneDrive Business in Excel file. I've tried bunch of things including sharing the PowerApps folder that Excel sits in but they still can't access the data. It works for me without any issue since it's on my OneDrive.

trbleile
Level: Powered On

Re: Reset all value controls in a multi page survey after the survey is completed/failed

I believe you will need to go to web.powerapps.com to create your connection. This connection should then be able to be shared with your users.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (6,273)