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

Editform returning unknown error.

Hello,

 

I am building an app to manage incoming client potential contracts.

 

The date source is Table1

 

I have a 3 page setup:

-Main_Screen

  • Contains gallery MAIN_GAL

-NEWform

  • Contains form COT_SUIVI

-CHANGEform

  • Contains form COT_EDIT

Note that both COT_SUIVI and COT_EDIT have dependancy dropdowns with the list from onedrive .xls file LIST_ONLINE_TYPE_TEST

 

From my main screen, i have a + button to create a new data entry in the data source.

Navigate(NEWform); NewForm(COT_SUIVI)

As well as an arrow selector in the gallery MAIN_GAL with the following formula:

Select(Parent); Navigate(CHANGEform); EditForm(COT_EDIT)

 

Once on the NEWform page, I have a save icon with the following OnSelect:

SubmitForm(COT_SUIVI); Refresh(Table1); Navigate(Main_Screen)

 

This SubmitForm function seems to work properly.

 

Here is my issue:

 

When I select an item in the MAIN_GAL with the arrow button, It takes me to the COT_EDIT form and the existing data is populated in the fields. But when, whether I change information or not, I select the save on that page.

 

The save button has the following formula:

SubmitForm(COT_EDIT); Refresh(Table1); Navigate(Main_Screen)

 

I get an unknown error on the save button and the modified values are not changed. (in the app and the data source)

 

After a few hours online trying to identify the error, I am at a loss.

 

Please help.

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Hi @LouisDP 

I have some suggestions for your app.  First, it is inefficient and unnecessary to have two screens with a new form and and edit form.  One screen with the form should suffice as the NewForm() and EditForm() functions set the mode of the form automatically (either New or Edit).  Using the NEWform screen as the target.  On the + icon (outside of the gallery) set the OnSelect property to 

NewForm(COT_SUIVI); Navigate(NEWform)

on the arrow icon (inside the gallery), set the OnSelect property to 

EditForm(COT_SUIVI); Navigate(NEWform);

The OnSelect property of save icon on the NEWform screen should only contain Submit(COT_SUIVI).  Your current formula will return to the gallery whether the form is successfully submitted or not.  You can place a Back() function in the OnSuccess property of the COT_SUIVI form to return to the main screen.  Then, if your data is correctly submitted, you will return to the main screen.  If it is not, you will stay on the form screen.  It should not be necessary to Refresh() the datasource as the gallery should automatically include the new or changed item.

Make sure that the DataSource property of the COT_SUIVI form is set to Table1 and the Item property of the COT_SUIVI form is set to MAIN_GAL.Selected 

The Item property is ignored when the form is in New mode (since there is no item being edited).

One further suggestion: Let PowerApps create your app from the data in your table automatically. Put your Excel file in your OneDrive for Business or DropBox or just leave it where it is.  To see how PowerApps will creates the app, go to Make.PowerApps.Com and select the all templates option.  Select the Starts from data option, choose Create.  Click on the new Connections and pick the connection that points to your data. Choose your Excel file and let PowerApps do its magic.  Once the app is created, you can check out the icons and see how it works.  

View solution in original post

3 REPLIES 3
Highlighted
Super User III
Super User III

Hi @LouisDP 

I have some suggestions for your app.  First, it is inefficient and unnecessary to have two screens with a new form and and edit form.  One screen with the form should suffice as the NewForm() and EditForm() functions set the mode of the form automatically (either New or Edit).  Using the NEWform screen as the target.  On the + icon (outside of the gallery) set the OnSelect property to 

NewForm(COT_SUIVI); Navigate(NEWform)

on the arrow icon (inside the gallery), set the OnSelect property to 

EditForm(COT_SUIVI); Navigate(NEWform);

The OnSelect property of save icon on the NEWform screen should only contain Submit(COT_SUIVI).  Your current formula will return to the gallery whether the form is successfully submitted or not.  You can place a Back() function in the OnSuccess property of the COT_SUIVI form to return to the main screen.  Then, if your data is correctly submitted, you will return to the main screen.  If it is not, you will stay on the form screen.  It should not be necessary to Refresh() the datasource as the gallery should automatically include the new or changed item.

Make sure that the DataSource property of the COT_SUIVI form is set to Table1 and the Item property of the COT_SUIVI form is set to MAIN_GAL.Selected 

The Item property is ignored when the form is in New mode (since there is no item being edited).

One further suggestion: Let PowerApps create your app from the data in your table automatically. Put your Excel file in your OneDrive for Business or DropBox or just leave it where it is.  To see how PowerApps will creates the app, go to Make.PowerApps.Com and select the all templates option.  Select the Starts from data option, choose Create.  Click on the new Connections and pick the connection that points to your data. Choose your Excel file and let PowerApps do its magic.  Once the app is created, you can check out the icons and see how it works.  

View solution in original post

Highlighted
Community Support
Community Support

Hi @LouisDP ,

Did you make some customizations on the edit form?

Usually, the submit functon doesn't work is because that you do not set right Update property of every data card.

Please check every data card's Update property.

If you make some changes to the data card, do not forget to change the Update property to the right formula.

 

 

 

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

Thank you for your help.

 

I will also keep an eye on my update property.

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 (9,986)