web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Use submit button to s...
Power Apps
Unanswered

Use submit button to send required fields

(0) ShareShare
ReportReport
Posted on by 271

Hello,

New to power apps here, I have a Sharepoint list and trying to customizing the form using power Apps. there are 3 pages in the form

Aysan_0-1598022983427.png

All the fields are required on 2 of the forms. On the first screen, the next button submit the form and checks if required fields are all entered

I user this formula for next button onselect= If(!SharePointForm1.Valid, SubmitForm(SharePointForm1), Navigate(Questioner,ScreenTransition.None));

Aysan_1-1598023147918.png

The part that I have an issue with is the last page and submit button :

Aysan_2-1598023318867.png

If I use Patch formula for submit button : 

Patch(Mentors,Defaults(Mentors),SharePointForm1.Updates,SharePointForm1_1.Updates);

Navigate(Navigate_End,ScreenTransition.Fade ); 

the form submits correctly but doesn`t check the required fields and the user can leave them black ( Although they are required on SP and Also Required=True on powerapps)

If I use submit onselect=SubmitForm(SharePointForm1_1) it will check the required field but somehow gives an error for a required field on sharepointform1 

 
 

I tried to use the same syntax as the Next button for the save button and it doesn't submit the form at all.

Any help is much appreciated.

 
 

 

 

 

 

 

 

 

Categories:
I have the same question (0)
  • SaiKrishnaGudluru Profile Picture
    499 on at

    @Aysan you can use DisplayMode option to validate the data.

     

    If you are using a button named - btnSubmit. Go to it's DisplayMode Property and try the If(IsBlank(DataCardValue1.Text) || IsBlank(DataCardValue2.Text),Disabled,Edit). This helps you to enable the Submit button only if the required fields are provided with some input value.

     

    DataCardValue1.Text and DataCardValue2.Text are data card values in the Form.

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at

    Hi@Aysan,

    Could you please share a bit more about the scenario, where do you specify your fields as Required, within your data source or the form?

    If you want the validation to work when you use the Patch() function to submit data, I am afraid that there is no way to achieve your needs.

    The Required property of the DataCard control within the form only works when you use SubmitForm() function to submit data. When you use the Patch() function to submit your data, the error message would not show up.

    As an alternative solution, you could add some validation into the Patch() function, please try the following workaround.

    Set All the fields in your SP list as the Required fields and set the OnSelect property of the Next Button as below:

     

    Navigate(EditScreen1_1)

     

    Set the OnSelect property of the Submit Button as below:

     

    If(
     !IsBlank(DataCardValue17.Text) && !IsBlank(DataCardValue18.Text) && ! IsBlank(DataCardValue19.Text) && !IsBlank(DataCardValue20.Text) && !IsBlank(DataCardValue10.Text) && !IsBlank(DataCardValue11.Text) && !IsBlank(DataCardValue12.Text) && !IsBlank(DataCardValue13.Text),
     Patch(
     Mentors,
     Defaults(Mentors),
     EditForm1.Updates,
     EditForm1_1.Updates
     ),
     Notify("Patch has something invalid!")
    )

     

    Note: All the DataCardValue represents the corresponding control for all columns in your SP list.

    Best Regards,

    Qi

  • Aysan Profile Picture
    271 on at

    thank you for your reply, so basically all the fields are required, on Sharepoint columns are required, same as on the form. 

    so you are suggesting that I include all the fields in if statement 

    If(
     !IsBlank(DataCardValue17.Text) && !IsBlank(DataCardValue18.Text) && ! IsBlank(DataCardValue19.Text) && !IsBlank(DataCardValue20.Text) && !IsBlank(DataCardValue10.Text) && !IsBlank(DataCardValue11.Text) && !IsBlank(DataCardValue12.Text) && !IsBlank(DataCardValue13.Text),

     Also, this is the notification that the user will see if a field is not filled? 

    Notify("Patch has something invalid!")

     

  • v-qiaqi@microsoft.com Profile Picture
    on at

    Hi@Aysan,

    So as you asked, I do suggest validating every required field.

    The formula I provided means that if all the required fields are filled successfully, the Patch() function will save data to SP list, otherwise, there will be a message popping up saying "Patch has something invalid!" and the Patch() function won't work as well.

    Best Regards,

    Qi

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard