Thank you for visiting my site!

Home / PowerApps - Forms / Form validation

Form validation

If You using forms (Start Custom form from the SharePoint List), prepare the validation:
  1. On screen Visible
    set the default variable to show error

    UpdateContext({
       
        showValTask: false,
        showValSomeOther: false,
        ....
    });
  2. Set the Text property for the error message
  3. set error label
    Visible = showValTask
  4. Hide the validation on the InputBox when do any changes
    OnChange UpdateContext({ showValTask: false})

     

  5. Finally do the validation OnSave
    If(showValTask || showValDescription || ...... ,
     UpdateContext({locIsAllValid: false}),
     UpdateContext({locIsAllValid: true})
    );
    
    If(
        !locIsAllValid,
        Notify(
            "An Form entry is required or has an invalid value. Please correct and try again.",
            NotificationType.Error,
            4000
        )
    );
    
    If(
        locIsAllValid,
        SubmitForm(frmNew);
    	UpdateContext({locRecord: frmNew.LastSubmit});
    	Refresh(Submissions)  
    );
    If(
        locRecord.ID > 0,
        Notify(
            "Deliverable has been Updated!",
            Success,
            5000
        );
        Navigate(scrGalleries,  ScreenTransition.Cover);
        
    ) 
  6. 
    

ADD YOUR COMMENT