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

New Form submission error: default value for a required field

I am trying to create a simple App that allows users to either update or add a record relating a particular client (stored in a SharePoint list).

 

I have a dropdown control that selects the client, and then filters a gallery showing all the existing records for that client.

PApp 1.pngDropdown filters Historical Support gallery.

 

Selecting the "pencil" icon in an item in the gallery makes Visible a Form in Edit mode, populated with the values from the selected gallery item.  Form submission with the Save icon for any edits is successful.

PApp 2.pngPencil makes form visible in edit mode

 

Selecting the "+" icon in any of the items in the gallery makes Visible the same form in New mode, with the SharePoint required field of "Supporter ID" ("Title" in Sharepoint) pre-poulated to create a new record for this same client.

PApp 3.png+ makes form visible in New mode

However, when the new form is submitted, I get the below error message in App Play mode:

PApp 4.pngApp Play submission error

Exiting Play mode and going back to the studio, it suggests that I was missing a required field, which is why submission failed. However, the field that I prepopulate in New form mode IS the required field! 

PApp 5.pngSubmission error: required field.

 

Any help would be much appreciated.

 

Thank you!

V

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: New Form submission error: default value for a required field

Hi @vscarpato1 ,

Could you please share a bit more about the "Supporter ID" data card within your Edit form?

How do you generate the Supporter ID within your New Form? Could you please share a bit more about the formula?

Further, do you change the Title name within your SP List?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:2.JPG

 

3.JPG

Set the DisplayMode property of the Text Input box within the Title Data card to following:

DisplayMode.View

set the Default property of the Text Input box within the Title Data card to following:

If(
    EditForm1.Mode = FormMode.New,
    "PowerApps IcM "& Now(),
    Parent.Default
)

Please check if the Supporter ID data card is bind to the Title field in your SP List properly. In other words, the DataField property of the Supporter ID data card should be set to following:

"Title"

 

In addition, when you save new record or edit an existing record into your SP List, you could consider use Patch function to achieve your needs instead of SubmitForm() function. Please consider set the OnSelect property of the "Save" icon to following:

If(
    EditForm1.Mode = FormMode.New,
    Patch(
              'YourSPList',
               Defaults('YourSPList'),
               {
                 Title: SupporterIDTextBox.Text,       /* <-- Please specify your pre-populated value for the Title column here  */
                 Date: DatePicker1.SelectedDate,
                 Support: SupportTextBox.Text,
                 Influence: InfluenceTextBox.Text
               }
    ),
    Patch(
             'YourSPList',
             Gallery1.Selected,
             {
                Date: DatePicker1.SelectedDate,
                 Support: SupportTextBox.Text,
                 Influence: InfluenceTextBox.Text
             }
    )
);
Type formula to hide your Edit form here ...

Please consider take a try with above solution, then check if the issue is solved.

 

You could also consider re-create a new SP list on your side, and do not rename the Title column, then try above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
vscarpato1
Level: Powered On

Re: New Form submission error: default value for a required field

NB: new form submission is successful if I remove the pre-population for the Supporter ID (aka Title) field and manually enter it. However, the ID is not something that my users know/have readily available ot them, so I want to pre-populate so they don't have to.

 

Please help!

Community Support Team
Community Support Team

Re: New Form submission error: default value for a required field

Hi @vscarpato1 ,

Could you please share a bit more about the "Supporter ID" data card within your Edit form?

How do you generate the Supporter ID within your New Form? Could you please share a bit more about the formula?

Further, do you change the Title name within your SP List?

 

Based on the issue that you mentioned, I have made a test on my side, and don't have the issue that you mentioned. The screenshot as below:2.JPG

 

3.JPG

Set the DisplayMode property of the Text Input box within the Title Data card to following:

DisplayMode.View

set the Default property of the Text Input box within the Title Data card to following:

If(
    EditForm1.Mode = FormMode.New,
    "PowerApps IcM "& Now(),
    Parent.Default
)

Please check if the Supporter ID data card is bind to the Title field in your SP List properly. In other words, the DataField property of the Supporter ID data card should be set to following:

"Title"

 

In addition, when you save new record or edit an existing record into your SP List, you could consider use Patch function to achieve your needs instead of SubmitForm() function. Please consider set the OnSelect property of the "Save" icon to following:

If(
    EditForm1.Mode = FormMode.New,
    Patch(
              'YourSPList',
               Defaults('YourSPList'),
               {
                 Title: SupporterIDTextBox.Text,       /* <-- Please specify your pre-populated value for the Title column here  */
                 Date: DatePicker1.SelectedDate,
                 Support: SupportTextBox.Text,
                 Influence: InfluenceTextBox.Text
               }
    ),
    Patch(
             'YourSPList',
             Gallery1.Selected,
             {
                Date: DatePicker1.SelectedDate,
                 Support: SupportTextBox.Text,
                 Influence: InfluenceTextBox.Text
             }
    )
);
Type formula to hide your Edit form here ...

Please consider take a try with above solution, then check if the issue is solved.

 

You could also consider re-create a new SP list on your side, and do not rename the Title column, then try above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 213 members 4,747 guests
Please welcome our newest community members: