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 / How to Trigger Field V...
Power Apps
Unanswered

How to Trigger Field Validation Error Messages on Multi-Page Forms

(0) ShareShare
ReportReport
Posted on by 29

I have created a three page SharePoint list form that has all but three fields as required. However, when I try to submit the the form with some fields being empty, it does not alert the user that the field is empty and the form is still submitted. Currently, I have a save button at the end of the form with the following code used OnSelect:

 

Patch('Contingent Worker Onboarding',Defaults('Contingent Worker Onboarding'),CWInfo_Form.Updates,JobInfo_Form.Updates,OtherCompany_Form.Updates)

Ideally I would like for it to set off the Error notifications that are trigged by default when using OnSubmit as shown below. Right now it I can only get this to work using the default Save button in SharePoint and it only works for the first page.

 

 

sampleerror.png

 

 

 

 

 

 

 

 

 

 

 

 

I've tried searching online but I cannot find any good examples/best practices on how to accomplish this efficiently. Everything I found shows how to use Patch on a Multi-page form but not how to manage validations. I also, have the following questions:

 

1. Would it be better to validate the fields after the entire form is filled out? Or would it be best to validate these fields when they click on the next button before they go to the next page?

2. Since my fields are required when I use Patch should I explicitly add every field in order for the validation to work or should continue to use what I am using (see code above).

3. I noticed when I use my custom save button to submit, when the user goes back to view/edit the form all but the first form fields are blank eventhough in the SharePoint list they all have values. How can I fix this?

 

Here are screenshot of my form for more information:

 

All the required fields are set on the List level and on the PowerApps form

 

Columns.png

 

SharePoint Integration Settings.

 

SharePointIntegration.png

 

First Page of the Form

 

Screen: CWInfo

Form: CWInfo_Form

 

 

Next Button OnSelect

NewForm(JobInfo_Form); Navigate(JobInfo,ScreenTransition.Fade)

 

 

Second Page of Form

Screen: JobInfo

Form: JobInfo_Form

 

JobInfo.png

 

Next Button OnSelect

NewForm(OtherCompany_Form); Navigate OtherCompany,ScreenTransition.Fade)

 

 

Third Page of Form

Screen: OtherCompany

Form: OtherCompany_Form

 

 

 

Save Button (Same as Above):

Patch('Contingent Worker Onboarding',Defaults('Contingent Worker Onboarding'),CWInfo_Form.Updates,JobInfo_Form.Updates,OtherCompany_Form.Updates)

 

Any advice would be greatly appreciated!

Categories:
I have the same question (0)
  • v-micsh-msft Profile Picture
    on at

    Hi @m_wllms,

     

    Multiple forms submit is only available using patch.

    But using the formula you provided, it will not work.

    Patch('Contingent Worker Onboarding',
    Defaults('Contingent Worker Onboarding'),
    CWInfo_Form.Updates,
    JobInfo_Form.Updates,
    OtherCompany_Form.Updates)

    The formula avove, for the record being submitted, only the last records data would be kept (OtherCompany_Form.Updates), the other two would be overwrite by blank value if the data has not been provided in the last records.

    Besides, all three form.updates should contain the required field.

     

    To workaround your scenario, you may need to build single control for each field, and then take use of patch to submit all the required field.

    Adding a thread for your reference:

    Multiple form submit

     

    Regards,

    Michael

  • m_wllms Profile Picture
    29 on at

    Hi @v-micsh-msft,

     

    Thank you for taking the time to help me. I have a question about the workaround you suggested. I am not sure what you mean by "build single control for each field". Have I not done that already in my form? Currently, I have a control for each of the required fields in the form. Is there something I am not understanding?

  • Gargoolgala Profile Picture
    270 on at

    Hi - did you get this sorted out? I have a very similiar problem

  • m_wllms Profile Picture
    29 on at

    No, unfortunately I didn't. I ended up having to create custom validation for each field. I used this to help me:

     

    https://powerapps.microsoft.com/en-us/blog/validation/

  • abd3127 Profile Picture
    320 on at

    Hello @Gargoolgala@m_wllms@v-micsh-msft

     

    Did u get any answer on how we can apply validations when using multiple forms??

    Can u give me an idea how did u use custom validations? I mean did u apply "isBlank" on every control?

  • seadude Profile Picture
    1,855 on at

    You might creating a single-screen app and controlling the form fields with Visibility instead of having 3 separate screens. I recently did this with an 80+ field form and it works great.

  • abd3127 Profile Picture
    320 on at

    @seadude

    Thanks for the suggestion.

    But we can not change this structure as it is client demand.

  • seadude Profile Picture
    1,855 on at

    You could build the app where they never know its a single screen. I use tabs to make it look multi-screen. Click "Next" button or another tab and visibility of form fields changes. Looks like they're going to another screen but their not. If a field on (fake) screen 1 was not filled in, show a popup. When they click "OK", change visibility back to (fake) screen 1 with built-in validation showing the field that was missed.

     

    Could be lot of rework for you though. Just an idea 🙂

     

    Good luck!

  • richcoresln Profile Picture
    13 on at

    I also discovered this problem when trying to achieve something similar.

    Quite surprised that this does not exist already.

    However, having the following on a screens "Next" buttons "OnSelect" function seems to work:

     

    If(!Form1.Valid, SubmitForm(Form1), Navigate(CustomFormScreen2));

    If there is a cleaner way to achieve this I'd be interested in knowing what it is.

  • seadude Profile Picture
    1,855 on at

    oooooohhH!! Thats pretty slick @richcoresln !!
    Does that work for partial form submissions?
    Example:

    • 60 field form
    • Split into "Subforms" for usability
    • Can you check .Valid on a certain section (Form1), then, IF Valid, move to next section (Form2)
    • Repeat, but have each SubForm submit results (Patch, really) to the original record?

    That sounds useful.

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard