Skip to main content

How to Validate a Form Without an Edit Form in Power Apps

· 10 min read
Jagdish Kumawat
Founder @ Dewiride

When a screen is built from separate controls and saved with Patch, nothing checks the values for you. Two pieces do the job: a message that shows the first thing wrong, and a Save button that stays disabled until every field is filled in and there's nothing wrong. Put the rules in one place, and both pieces use them.

The example is the Overtime Timesheet app's Log overtime screen. It builds a shift's start, finish and hours from several controls, so it saves with Patch. Microsoft's guidance is to use SubmitForm with an Edit form, which handles validation, field mapping, and error display automatically, and Patch to build a completely custom save experience (Understand data sources for canvas apps). With Patch, the checking is yours.

The Plan​

Kind of checkExampleWhere it lives
A field is filled inA finish time is chosen; the reason isn't emptyThe Save button's DisplayMode
A rule across fieldsThe break is shorter than the shiftA function that returns the first problem, shown in a label

The SharePoint list has its own validation rule as well, set up in Part 2, for entries edited in the list itself.

Prerequisites​

Step 1: Write the Rules in One Function​

The app's ShiftProblem function takes the shift's date, times and break, and returns a sentence for the first rule they break, or empty text when they break none:

App → Formulas
ShiftProblem(ShiftDate: Date, StartAt: Time, EndAt: Time, BreakMins: Number): Text =
With(
{Starts: ShiftStart(ShiftDate, StartAt), Ends: ShiftEnd(ShiftDate, StartAt, EndAt)},
With(
{
Minutes: DateDiff(Starts, Ends, TimeUnit.Minutes),
Clash: LookUp(OvertimeEntries, EmployeeEmail = MyEmail && StartTime < Ends && EndTime > Starts)
},
If(
EndAt = StartAt, "The start and finish times are the same.",
Minutes > 1440, "A shift can't be longer than 24 hours.",
BreakMins >= Minutes, "The break must be shorter than the shift.",
Ends > Now(), "This shift hasn't finished yet. Log it after it ends.",
!IsBlank(Clash), $"This overlaps the overtime you logged from {Text(Clash.StartTime, "dd/mm/yyyy hh:mm")} to {Text(Clash.EndTime, "dd/mm/yyyy hh:mm")}.",
""
)
)
);

Step 2: Show the Problem in a Live-Region Label​

The message is a classic Label, lblProblemLO, under the last field and above Save. Its Live property is Live.Polite, which makes it a live region: screen readers announce a change to its text. Its Color is Color.DarkRed, and AutoHeight is on, so it grows to fit a long message.

Its Text asks for the problem only once both times are chosen, so nobody is told off for a form they haven't finished:

lblProblemLO → Text
If(
IsBlank(cmbStartLO.Selected) || IsBlank(cmbEndLO.Selected),
"",
ShiftProblem(dpWorkDateLO.SelectedDate, cmbStartLO.Selected.Value, cmbEndLO.Selected.Value, numBreakLO.Value)
)

The Text property of lblProblemLO in the expanded formula bar: If either combo box's Selected is blank, empty text, otherwise ShiftProblem with the date picker's SelectedDate, both chosen times and the break

IsBlank(cmbStartLO.Selected) is the check for an empty combo box. IsEmpty(cmbStartLO.SelectedItems) looks right but returns false before anything is chosen: Fixed: IsEmpty Returns False When Nothing Is Selected in a Power Apps Combo Box.

Step 3: Disable Save Until Everything Is Right​

Save's DisplayMode is Edit only when every field is filled in and the label has nothing to say:

btnSaveLO → DisplayMode
If(
!locIsSaving &&
!IsBlank(dpWorkDateLO.SelectedDate) &&
!IsBlank(cmbStartLO.Selected) &&
!IsBlank(cmbEndLO.Selected) &&
!IsBlank(cmbDepartmentLO.Selected) &&
!IsBlank(Trim(txtReasonLO.Text)) &&
IsBlank(lblProblemLO.Text),
DisplayMode.Edit,
DisplayMode.Disabled
)

The DisplayMode property of btnSaveLO in the expanded formula bar: If not saving and the date, start, finish and department are chosen, the trimmed reason isn't blank and lblProblemLO's Text is blank, DisplayMode.Edit, otherwise DisplayMode.Disabled

Step 4: Try Each Rule​

In Preview, with an empty form, Save is disabled and there's no message:

The Log overtime screen in Preview with today's date, Start and Finish showing Choose a time, a break of 0, the line Choose the start and finish times to see the hours worked, an empty department and reason, and a disabled Save button

Then each rule, with every other field filled in. The same start and finish, 23:00 and 23:00:

The Log overtime screen with Start 23:00 and Finish 23:00, Hours worked: 0.00 (0 h 0 min), the red message The start and finish times are the same, and a disabled Save button

A break as long as the shift, 60 minutes for 22:00 to 23:00:

The Log overtime screen with Start 22:00, Finish 23:00 and an unpaid break of 60, Hours worked: 0.00 (0 h 0 min), the red message The break must be shorter than the shift, and a disabled Save button

More than 24 hours: 00:30 on 25 October 2026 to 00:25 the next day. That's normally 23 h 55 min, but the clocks went back that day, so it's 24 h 55 min:

The Log overtime screen with the date 25/10/2026, Start 00:30 and Finish 00:25, Hours worked: 24.92 (24 h 55 min), the red message A shift can't be longer than 24 hours, and a disabled Save button

A shift that hasn't finished, today from 23:00 to 23:30, entered earlier in the day:

The Log overtime screen with the date 08/11/2026, Start 23:00 and Finish 23:30, Hours worked: 0.50 (0 h 30 min), the red message This shift hasn't finished yet. Log it after it ends., and a disabled Save button

With every field filled in and nothing wrong, the message disappears and Save is enabled:

The Log overtime screen in Preview with the date 24/10/2026, Start 22:00, Finish 06:00, a break of 60, Hours worked: 8.00 (8 h 0 min), Emergency Department, a reason with 81 of 500 characters, no message and an enabled green Save button

Common Mistakes​

MistakeWhat happensDo this instead
IsEmpty(combo.SelectedItems) for "nothing chosen"It's false before anything is chosen, so the check passesIsBlank(combo.Selected)
!IsBlank(txt.Text) for a required textA reason of only spaces counts as filled in!IsBlank(Trim(txt.Text))
Writing each rule in both the label and the buttonThe two drift apart when one is changedRules in one function; the button checks the label
Every problem at onceA wall of red, and nobody knows where to startReturn the first problem only
Showing problems before the fields are filled inPeople are told off while still typingCheck only once the fields the rules need are chosen

Troubleshooting​

SymptomLikely causeFix
Save stays disabled though everything looks rightOne condition is still falsePut each condition into a text control for a moment, such as IsBlank(cmbEndLO.Selected), and see which one
A screen reader doesn't read the messageThe label isn't a live region, or it's a modern Text controlA classic Label with Live set to Polite
The message never appearsThe label's Text doesn't call the function, or it's hiddenCheck its Text and Visible

FAQ​

Why not use an Edit form?​

An Edit form saves one card per column. This screen works out several columns from the same controls: the start and finish from a date and two times, and the hours from both. Patch writes what the formula builds (How to Save a Date and Time to a SharePoint List with Patch in Power Apps).

Does the SharePoint list check anything?​

Yes. Its validation rule refuses a finish that isn't after the start, a shift over a day, and a break as long as the shift, for anyone who edits an entry in the list itself (How to Add List Validation in SharePoint to Compare Two Columns). The app checks first and tells people in plain words.

Conclusion​

Write the rules once, as a function that returns the first problem; show it in a live-region label once the fields it needs are filled in; and enable Save only when every field is filled in and the label is empty.

Additional Resources​