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 still saving eve...
Power Apps
Answered

Patch still saving even the list item are required.

(0) ShareShare
ReportReport
Posted on by 28

Hi Everyone,

 

I'm currently having an issue with PowerApps patch function, I have SharePoint list, I have configured Columns to be required. However, when I'm patching please see Image 2, even the 2 column are null value, patch still saves. Please see image 3.

Patch still saving even the list item are required image 1.png
Patch still saving even the list item are required image 2.png
Patch still saving even the list item are required image 3.png
Categories:
  • cha_cha Profile Picture
    4,932 Moderator on at

    Hello @a104230 

     

    Patch function does ignore those "Required" properties and what you can do is modify your code and put your patch inside an If function.

    If(
    	Or(
    		IsBlank(TextInput1.Text),
    		IsBlank(TextInput1_1.Text)
    	),
    	Notify("Blank inputs")
    	,
    
    	//Patch Code here 
    	Notify("Saved")
    )

     

  • a104230 Profile Picture
    28 on at

    Thanks for this @cha_cha ! However, there are certain video blogs in YouTube that patch function does not push if the column is required and the control is Blank.

  • cha_cha Profile Picture
    4,932 Moderator on at

    Hello @a104230 

     

    I understand what you meant there however the validation in Patch only checks if the field exist in the Patch. For example, if your Patch says

     

    Patch(SPListName, Defaults(SPListName),{'Vendor Name': TextInput1_1.Text}), this would be flagged cause a required column named "Title" is not present in your Patch.

     

    In your given code, both Title and 'Vendor Name' are present so they satisfied the requirement that the required field is present. Technically, Patch still acknowledges that an empty input textbox is still a valid value that's why it gets added to SharePoint even though SharePoint doesn't recognize a text without characters as a valid entry. We cannot make changes to the innate behavior of the Patch function which is why a preliminary checking of input value is needed to workaround the limitations.

     

     

    cha_cha_0-1685314596434.png

     

  • a104230 Profile Picture
    28 on at

    Good day @cha_cha , please see below article I have been trying to replicate.

    https://www.matthewdevaney.com/power-apps-patch-function-error-handling/

  • Verified answer
    cha_cha Profile Picture
    4,932 Moderator on at

    Hello @a104230 

     

    Which part of the given link were you trying to replicate?

     

    My initial provided code has the structure that you need to not Patch the data if either the Title or the Vendor is empty. You just have to add your patch code to the designated place indicated by the comment "//Patch code here"

     

    Here's what I gave:

    If(
    	Or(
    		IsBlank(TextInput1.Text),
    		IsBlank(TextInput1_1.Text)
    	),
    	Notify("Blank inputs")
    	,
    
    	//Patch Code here 
    	Notify("Saved")
    )

     

    And here's how how you can do it:

    If(
    	Or(
    		IsBlank(TextInput1.Text),
    		IsBlank(TextInput1_1.Text)
    	),
    	Notify("Blank inputs")
    	,
     
    	Patch(
    		SPListName, 
    		Defaults(SPListName),
    		{
    			Title: TextInput1.Text,
    			'Vendor Name': TextInput1_1.Text
    		}
    	);
    	
    	Notify("Saved");
    )

     

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 350 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 318

#3
Mohsin Ali Profile Picture

Mohsin Ali 220

Last 30 days Overall leaderboard