Parsware
All articles

Power Apps

Quick create in the dialog

A three-field drawn form for a new case, opened in the app’s own dialog. Create writes the row and closes the dialog, and the list behind it reads its rows again.

A New case dialog over the Open cases list, with a summary typed in, a priority and an Urgent box

A new case needs a summary, a priority and whether it is urgent. The table’s full form asks for much more, and quick create is a per-table switch with a form of its own. This demo draws the three fields, opens them in the app’s dialog, and puts the list behind it back in step when it closes. In the samples: Demos → Open cases.

The Open cases page: 200 cases, newest first, and a New case button

The button and the form

New case opens a second design in the dialog: openDesign("New case"). A dialog is what openDesign does when you don’t name a place.

The New case dialog: Summary filled in as Projector bulb has gone, Priority Normal, an Urgent box, and Create and Cancel

Create checks the summary, turns the priority’s words into the choice’s number, writes the row and closes the dialog it is in:

if (state.form.par_name == "") {
  notifyError("A case needs a summary.");
} else {
  var value = 100000002;
  if (state.priority == "Low") { value = 100000001; }
  if (state.priority == "High") { value = 100000003; }
  createRecord("par_case", { par_name: state.form.par_name, par_priority: value, par_urgent: state.form.par_urgent });
  notify("Case created.");
  closeDesign();
}

The list reads again

The page has an A design it opened closed handler, which runs when the dialog goes, however it went: Create, Cancel or the dialog’s own cross. It counts and reads the list again, so the new case is at the top:

The Open cases list again, now 201 cases, with Projector bulb has gone at the top

This is what openDesign could not do before. It never waits for the dialog, because a handler runs under a one-second budget. The host calls the page back when the dialog closes instead.

Try it

  1. Install the three Parsware for Power Apps solutions, samples included (Install it).
  2. Open Sample data and press Replace, so the newest columns are filled (The samples, and sample data).
  3. Open Demos → Open cases and press New case.

The pictures show the shipped design running on demo data in Parsware’s own runtime. In Power Apps the form, the side pane and the dialog are the app’s own.