Power Apps Patch with Microsoft SQL Server
Oct 9, 2023 7:00 AM

Power Apps Patch with Microsoft SQL Server

by HubSite 365 about Darren Neese (PowerApps Tutorial)

Power Apps Trainer at Neeseus

Citizen DeveloperLearning Selection

Master Power Apps Patch function with Microsoft SQL Server through our complete guide.

Guide to Mastering the Power Apps Patch Function with Microsoft SQL Server

In a recent YouTube tutorial by Darren Neese, the developer delves into the efficient use of Power Apps Patch function with Microsoft SQL Server. This guide helps those who've been wrestling with using Patch to create, update, or delete records in SQL Server. Power Apps enables you to employ SQL Server as a back-end database, efficiently managing your data.

During the tutorial, an inventory database was created with a table of basic data types. This yielded an environment where a simple canvas app was created in tablet mode, consisting of controls and elements placed on a single screen. These controls - such as text input, numeric input, and date picker - enhance functionalities such as name, product weight or launch date of different items.

The core of this process takes place when the Patch() function is called. This function is then configured with the data input fields provided by the different controls. For instance, the UpdateContext function concatenates all values selected from the dropdown control and provides it to the Patch function. The Patch function, in turn, allows the creation of a new record, and enables updates as necessary.


Data types have different compatibilities with Power Apps. For example, text, binary, date, and image values can be directly written to SQL columns. However, numeric and GUID values must be cast once again to be successfully saved.

An important tips for application makers is to provide a cancel button or something similar to enable users to reset the form if needed. So, on the Cancel Button's OnSelect, the Reset function is put in place to reset all controls' inputs.

But the Patch function is not without its challenge. It can be quite difficult to debug. A verbose error response greeted the instructor when he turned SecondaryId column into a mandatory input but forgot to do so in the app. There can be more cryptic errors, further emphasizing the need for meticulous accuracy on the front-end.

Performance is also a pivotal consideration. Avoid creating forms that will store too many inputs in the SQL server. Manage the number of inputs screens to avoid overwhelming the application.

For more information about SQL Server and Power Apps, visit Hubsite365.

Discussion of SQL Server and Power Apps in General

The use of SQL Server with Power Apps brings a lot of power and flexibility to app development. It allows you to store and manage data efficiently, enabling you to deliver high-performance apps. With Power Apps, you can create a range of apps - from simple canvas apps to complex model-driven apps.

Learning how to properly use the Patch function and other Power Apps functions with your SQL Server can help you fully leverage the capabilities of both tools. You can now efficiently create, update, or delete records, handle different data types and even debug issues. It provides you the flexibility and power to get the most out of your application.

Given the constant advancement in technology, learning how to use these tools effectively is essential for any developer. Training materials such as Darren Neese's tutorial make it easier for users to understand and master these technologies.

SQL  and SQL Server - Microsoft SQL Server Power Apps Patch: Comprehensive Guide

Learn about Complete Guide: Microsoft SQL Server Power Apps Patch


Let's dive deep into the key steps of creating a Power Apps Connected Canvas App, primarily focusing on the utilization of the Patch function with a relational database system. We aim for you to grasp not just the understanding of how to use the Patch function, but also to learn about different mapping procedures for different data types.

  • Unleashing the Power of Patch

To start, it is crucial to note that the Patch function is one of the most integral parts of executing operations in Power Apps. The Patch function is employed to modify numerous field values within a record or generate a record. In the provided context, the Patch function used to interact with a relational database system or in other words, RDBMS makes it possible to update, create, or delete records.

  • Understanding the Power Apps Patch Function

The Patch function is called within the formula language, allowing you to configure it with various types of data input fields. The Patch function's versatility stems from being able to be invoked like any other function tied to a behavioral property. Such flexibility enables the users to save inputs to multiple data sources simultaneously or in a hidden fashion, tracing it to screen transitioning or when the app is being opened.

  • Dealing with Different Data Types

In the process of employing the Patch function, it's significant to comprehend the core RDBMS data types and how they map to input coming from Power Apps. Mapping of data types like text, binary, date, and image values can be done directly to the RDBMS columns, yet values like numeric and GUID need to be cast once again for them to be saved successfully.

  • Reset Function Convenience

The Reset function is a convenient tool in the Power Apps toolbox that can be used to reset data inputs for all controls. The Concurrent wrapper around the Reset function allows multiple resets to happen at once, enhancing app performance and user convenience.

  • Important Considerations

While using the Patch function efficiently, it is key to keep in mind certain considerations such as maintaining an optimized payload size, ensuring suitable performance, troubleshooting potential errors and accommodating a range of complex scenarios.

  • Further Learning Resources

To delve deeper into this topic, consider studying the Patch and Concat functions in more detail. Moreover, the work and insights shared by experts in this domain, like Hristo Hristov, offer an invaluable learning resource for those who want to dive deeper into mastering power apps and related technologies.


More links on about Complete Guide: Microsoft SQL Server Power Apps Patch

Using Power Apps Patch Function with SQL Server
Nov 2, 2021 — In this article we look at how to create a basic Power App that allows saving data to a database table.
Patch function in Power Apps (contains video)
Feb 22, 2023 — Modifies or creates one or more records in a data source, or merges records outside of a data source. Use the Patch function to modify records ...


Microsoft SQL Server Power Apps Patch, SQL Server guide, Microsoft Power Apps Patch, SQL Server Power Apps Guide, Power Apps Patching, SQL Server Patching, Microsoft SQL Patch Guide, Power Apps SQL Patch, SQL Server Power Apps update, Microsoft SQL Server Update Guide