web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch() does not put N...
Power Apps
Answered

Patch() does not put NULL into a NULL-able column of my SQL table

(0) ShareShare
ReportReport
Posted on by 75

I have an SQL table with a column that looks like this:

     MyColumn [nvarchar](2000) NULL

 

I have created a simple Canvas app wit a Gallery whose data source is the SQL table. In the Gallery I have a Text input component attached to MyColumn column. When an end-user enters blank string (or clears the component, as we could call it) in the component and then the component is saved into DB ,I see that a blank string was put into the DB column MyColumn.

I do not want the blank string in the DB in this situation; I want NULL. I have tried to resolve the problem this way: in OnChange property of the |Text input control I wrote this:


Patch('MyTable',ThisItem,

                {MyColumn:If(IsBlank(t_TextInputComponent.Text), Blank(), t_TextInputComponent.Text)l})

 

But this has not worked: a blank string was put into the DB column anyway.

 

How can I solve the problem?

Categories:
  • Verified answer
    Akser Profile Picture
    1,546 Moderator on at

    AFAIK You need to turn on formula level error management (Settings)

     

    See more: https://powerapps.microsoft.com/en-us/blog/new-feature-error-handling-and-writing-null-values-to-databases/

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 220 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 194 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 150

Last 30 days Overall leaderboard