u/FreeFoodILike

▲ 2 r/PowerApps+1 crossposts

Schema-Driven CRUD Form Dialog | Downloadable Example App | Quick Guide

Why I Built This Component

After building multiple CRUD apps, repetitive form maintenance became painful:

  • duplicated controls
  • Patch logic all over the place
  • layout inconsistencies
  • hardcoded validation everywhere

Wanted to explore a more configurable + maintainable approach for Canvas Apps at scale.

Downloadable here: https://github.com/KiMi5555/PowerApp_Schema-Driven_CRUD_Dialog

Core Idea

Instead of manually creating forms for every table/entity:

  • define a FormSchema
  • render fields dynamically through a gallery
  • collect standardized FormData
  • Patch normally afterwards

The goal is to make forms:

  • reusable
  • configurable
  • easier to maintain
  • less tied to specific data sources (Source-Agnostic, even Excel)

Current Features

  • Dynamic field rendering
  • Text / Dropdown field support
  • Schema-driven labels
  • Structured FormData output
  • User Defined Form CRUD flow/logic
  • Reusable dialog component

Still WIP:

  • validation system
  • more field types
  • cleaner schema DX

Component Quick Usage Guide

Setup Video Available Here: https://www.reddit.com/r/PowerApps/s/grbYPd2a02

1. Prerequisite (Initial Setup)

In your Own App, ensure:

  • Component is Imported and Inserted (MyComponent)
  • Reorder MyComponent to the FRONT.
  • Gallery of your Data Source (MyGallery)
  • App.OnStart( ) = Set(gbl_IsDialogOpen, false); Set(gbl_DialogMode, "New");
  • MyComponent.Width = Parent.Width
  • MyComponent.Height = Parent.Height
  • MyComponent.Visibile = gbl_IsDialogOpen
  • MyComponent.DialogMode = gbl_DialogMode
  • MyComponent.SelectedRecord = MyGallery.Selected
  • MyComponent.OnEdit = Set(gbl_DialogMode, "Edit")
  • MyComponent.OnDialogClose = Set(gbl_IsDialogOpen, false)

2. Define Your Form Schema

In App.Formulas, define your Form Schema

Example:

MyFormSchema = Table(
    {
        Type: "text",
        Label: "Title",
        Required: true,
        SelectedValue: MyGallery.Selected.Title
    },
    {
        Type: "dropdown",
        Label: "Department",
        Required: false,
        SelectedValue: MyGallery.Selected.DeptCode
        Items: AddColumns( 
                MyDepartmentSource,
                ItemLabel,
                ThisRecord.DepartmentName,
                ItemValue,
                ThisRecord.DepartmentCode,
    }
)

Refer to the Table below to customize your Form Fields.

Param Input Type Explanation
Type "text" // "dropdown" Defines the Field Type. For now, only text & dropdowns are supported. More will be added later on.
Label Text A Unique Identifier for your Field Label/Header. This is also used for LookUp() when using FormData
Required Boolean Whether the Field can be left blank. As of now, is broken and may not work properly. TBC :3
SelectedValue Selected Gallery Item's Property The Data Referred to when Dialog is in Edit Mode.
Items AddColumn( DropDownData, ItemLabel, ThisRecord.<ColA>, ItemValue, ThisRecord.<ColB> ItemLabel = Dropdown Options to Render, ItemValue = Value each Option Holds

3. Pass Schema Into Dialog

The dialog dynamically renders fields based on the schema configuration.

MyComponent.FormSchema = MyFormSchema

4. Custom Form Logic + Centralised FormData

The Form Events OnCreate() / OnSave()/ OnDelete() can be customized to cater to your business needs and requirements.

The FormData can be accessed using LookUp(Self.FormData, Label = "MyLabel").Value

// Sample Code for OnCreate() / OnDelete()/ OnSave()

// OnCreate
Patch(
  MyDataSource, 
  Defaults(MyDataSource), 
  {
    ID: GUID(),
    Title: LookUp(Self.FormData, Label = "Title").Value,
    Department: LookUp(Self.FormData, Label = "Department").Value
  }
);

// OnDelete()
Remove(MyDataSource, MyGallery.Selected);

// OnCreate
Patch(
  MyDataSource, 
  Defaults(MyDataSource), 
  {
    Title: LookUp(Self.FormData, Label = "Title").Value,
    Department: LookUp(Self.FormData, Label = "Department").Value
  }
);

Feedback Please ❤️

Would love feedback / ideas from others experimenting with similar patterns.

u/FreeFoodILike — 19 hours ago

Generic Customisable CRUD Dialog

Been experimenting with building a reusable Smart CRUD Dialog system for Power Apps lately

Instead of manually rebuilding every form/dialog for each table, you define a schema and the component dynamically renders the form + handles the form state.

It also outputs a structured FormData table, so everything stays centralized instead of scattered across controls/formulas.

Main thing I wanted was:

  • less repetitive CRUD work
  • more consistent UI/logic
  • easier scaling when apps start having lots of entities/tables

You can still fully customize behaviors too (OnCreate, OnSave, OnDelete, etc.) so it’s not one of those super rigid generators. Kinda inspired by the flexibility of ShadCN where you own the logic/UI if you want to tweak stuff.

Still very WIP and definitely fighting Power Apps reactive quirks along the way :3 but it’s working surprisingly well so far.

Thinking of adding:

  • better validation system
  • error messages
  • more field types
  • conditional rendering
  • more UI customization

If people are interested, I can clean up the component export + share it.

Looking Forward to hear yall opinions !!

Might also make a YouTube video breaking down how the architecture/setup works.

u/FreeFoodILike — 1 day ago