cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Post Prodigy
Post Prodigy

Avoid form getting reset after submitting

Hello!

I want my form to be sent and only reset a few datacardvalue's. How do I do this? 

I know I need to do something with the method "OnSuccess" in the EditForm properties. How do I do this? 🙂 

1 ACCEPTED SOLUTION

Accepted Solutions

Please Look at the variable again:
1.Set(ResetValue," ") This is a variable that says no value or blank.
2. Then put the variable name: ResetValue into the Default of of all the Datacardvalues that you want cleared or blank after success.

So if you want 4 datacardvalues, in each one of them, put the variable name: ResetValue into its default property


Hope is clear

View solution in original post

11 REPLIES 11
Super User III
Super User III

Hi @TimoMigchielsen ,

Two ways 

  1. For a temporary situation, Patch the relevant fields instead of using SubmitForm
  2. For permanent, remove the Update property of all the other cards

There are also some hybrid solutions such as conditional Update values based on a set Variable

I am not sure of your second question - you can run code on the OnSuccess property. 

 

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.

Hey!

So basically, I have a few datacards and I whenever I submit the form, I want a few datacards to get cleared and some datacards should keep their information they filled in. 

I tried to put this in OnSuccess:

Reset(DataCardValue22)

But this does not work. 

@WarrenBelz 

Hi @TimoMigchielsen ,
I thought by reset, you meant at the data source. I get your issue now.
Try this - on the Default property of the cards you want reset<

If(
   vReset,
   Blank(),
   What the default is now
)

On the OnSuccess of the form

UpdateContext({vReset:true});
Reset(Card1);
Reset(Card2) etc etc

On screen exit (and screen entrance to be safe)

UpdateContext({vReset:false})

This should work (although I have not tested it)

 

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.

You can put this Variable on success:
Set(ResetValue," ")
Then put the ResetValue in the Datacardvalue22

Could you explain this more in detail? 

 

Would I just have to do this?

Set(DataCardValue22," ")

What if I want to do it with multiple datacards? Would it go like this?

Set(DataCardValue22," "); Set(DataCardValue21," "); Set(DataCardValue20," ")

@eka24 


Whenever I try this: Set(DataCardValue22, " ")

I get this error: Unexpected Characters. The formula contains "Ident" where "Control" is expected.

Please Look at the variable again:
1.Set(ResetValue," ") This is a variable that says no value or blank.
2. Then put the variable name: ResetValue into the Default of of all the Datacardvalues that you want cleared or blank after success.

So if you want 4 datacardvalues, in each one of them, put the variable name: ResetValue into its default property


Hope is clear

View solution in original post

Thanks, worked!

Am glad I was able to help

I have done what you said but now everytime I open a ticket and want to edit that ticket the default will be set to " " how can I avoid this? @eka24 


Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (11,296)