cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

How to Reset to NewForm when you have Default Values

I have a PowerApp with a SP List behind it, but also 10 fields that pull from a Azure SQL Database. 

When a user clicks the "+" button to create a new record, they type in an invoice number, search the SQL DB to find it, and once found, this pulls in the other 9 fields from the SQL Database. On the Datacard for each of these fields, under "Default" I have a formula that reflects the selected invoice number and the column - in this sample it is the invoice number: selectedInvoice.Invoice_x0020_Number

 

All 10 fields have the default value set as the "selectedInvoice"."SQLColumn" 

When the Form is submitted, the values all save back to the SP list, which is as desired.

 

However, when I then go to add another record, the 10 "default" SQL values are already populated, which I don't want, I want a true reset Form. 

On the Submit icon under OnSelect I have: SubmitForm(Form1);ResetForm(Form1)

On the "+" icon for adding a new record on OnSelect, I have: NewForm(Form1);Navigate(InputScreen)

 

No matter what I am trying, I can't seem to get the NewForm without those 10 default SQL values. 

 

Anyone have any ideas?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Advocate II
Advocate II

Re: How to Reset to NewForm when you have Default Values

I was able to reset the Form with the help of a few PowerApps gurus. In the OnSelect, set this:

 

SubmitForm(Form1);
Set(
selectedInvoice,
Blank()
);
ResetForm(Form1);

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Re: How to Reset to NewForm when you have Default Values

Hi @DS2 ,

 

Did you mean that you want to create records for SharePoint list, but you want to use the data from Azure SQL database? 

 

Usually, the Default property of data cards inside edit form is:

 

ThisItem.SharePointListColumnName

But in your case, you said that you are using "selectedInvoice.Invoice_x0020_Number". Which one is the data source of this Form control? One Form can only have one data source, and using SubmitForm will only update record to this data card. You cannot have Azure SQL database set as the data source of Form control, then use SubmitForm control to update data to SharePoint list.

 

Sorry but I didn't fully understand what you mean by "default value set as the "selectedInvoice"."SQLColumn". When the Form is submitted, the values all save back to the SP list"? If Default property is set to SQL column, then even if you reset the Form control, it should still be reset back to Default property which is SQL column.

 

Please help to explain more details about this app, maybe with some sample data of the related data sources. Some screenshots would be even better. 

 

Do mask sensitive data before uploading.

 

Regards,

Mona

 

 

 

 

 

 

 

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Frequent Visitor

Re: How to Reset to NewForm when you have Default Values

Thank you @v-monli-msft ! Here is how the App works:

  1. Click the "Plus" sign to open a screen with Form1 - to enter a new record.
  2. The Input Screen Opens, with Form1
  3. We have 10 Fields that pull from Azure Sql and the others are pulling from a SharePoint List:
    (I have attached the picture as I can't seem to add an image)
  4. Once we add the Invoice Number, the 9 other SQL fields appear.
  5. We click the Save Icon, and all is saved to SharePoint with no problem and we are brought to the home screen in the PowerApp
  6. We then Click the "Plus" sign to open a screen with Form1 - to enter another new record
  7. The 10 default fields from SQL are present in the New Form. Reset Form does not work because we have default fields set. 

 

 

 

Highlighted
Advocate II
Advocate II

Re: How to Reset to NewForm when you have Default Values

Did my info help? Is there any guidance on this? Thanks!
Highlighted
Advocate II
Advocate II

Re: How to Reset to NewForm when you have Default Values

I was able to reset the Form with the help of a few PowerApps gurus. In the OnSelect, set this:

 

SubmitForm(Form1);
Set(
selectedInvoice,
Blank()
);
ResetForm(Form1);

View solution in original post

Helpful resources

Announcements
secondImage

New Return to Workplace

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

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,557)