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 / Turning on formula-lev...
Power Apps
Answered

Turning on formula-level error mgmt causes more errors in Patch, insisting that fields are required, but they are already in the Patch code

(0) ShareShare
ReportReport
Posted on by 189

I was over here on this post, which said to turn on Formula-level Error Management in the app settings because I needed to patch a Blank() to a date field.

 

However, now I'm getting errors I've never had before in my Patch code, about other required fields.

 

My Patch code is 

 

 

Patch(
 'CDS Entity',
 Defaults('CDS Entity'),
 { 
 UserID : "10412"
 DateSurveyTaken : Today(), 
 Name : varMindID&"-"&Today()
 }
)

 

 

UserID is a Text field. DateSurveyTaken is a Date field. Name is a Text field. All are required.

 

My second Patch code elsewhere in the app is

 

 

Patch(
 'CDS Entity2',
 Defaults('CDS Entity2'),
 { 
 SubmittedDate : Blank()
 }
)

 

 

 

 

With the feature turned OFF, the first Patch works perfectly, but the second Patch fails (doesn't remove the date from SubmittedDate, but no error is flagged in the Canvas app).

 

With the feature turned ON, the second Patch works as desired by removing the date in SubmittedDate, but the first Patch now flags errors for UserID, DateSurveyTaken and Name (one at a time), saying that "this field is required". But I already have them in the Patch and have given them valid values! The only way to get past the errors is to go to PowerApps and set the fields as Optional/Recommended instead of Required. So first it flagged an error for UserID, so I changed that field to not required. Then it just picked up the next required field DateSurveyTaken to flag an error about, so I changed that and then Name got flagged and so on. Without any required fields, Patch doesn't save any values to the CDS record. It can create the new record but all fields are blank, even though my variables are all populated and I'm passing valid values through in my Patch code.

 

But why? Everything worked perfectly without the feature. I need the feature for the blank() date but I'd also like to know why the feature is seeing an issue with my required fields.

 

Edited: At first I thought it was fine with UserID being required but now it's getting flagged too! I can't have ANY required fields. And this is now a BIG problem because without any required fields Patch is just creating an empty record and isn't saving the perfectly legit values that I am passing.

Categories:
I have the same question (0)
  • eka24 Profile Picture
    20,925 on at
    If the datefield is required in CDs, make it optional or not required. That should allow blank or " ". You can even exclude it in the patch formula

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
  • Lexicon_ Profile Picture
    189 on at

    My main question is NOT about the date or the blank() value. It's about the required fields that the feature is having an issue with.

     

    Are you suggesting that instead of dealing with using the feature but being unable to have any required fields, that I should turn the feature off, retain my required fields, but just set the Date field to not required so as to hold a blank value?

     

    That doesn't work either because I need to be able to patch { SubmittedDate : Blank() } because that field will sometimes have a date value in it assigned by another process. I need to take action to clear out the date that was assigned before. 

     

    It's an activity/exercise app. The user can redo the activity multiple times. They can also start an activity but not submit it (they will save it to continue another day). When they start an activity there is a StartedDate. When they complete and submit an activity there is a SubmittedDate. When they start an activity that they've submitted before, it is seen as a new instance which means there is a StartedDate and the previous SubmittedDate is cleared out, until such a day that they submit it and then it gets stamped with the SubmittedDate. And it repeats. 

     

    I need the SubmittedDate to not have any value when an activity is in progress/saved but not submitted, because there is a Calculated field that looks at whether SubmittedDate contains data to determine the state of the activity.

     

    But again, about the required fields vs the feature. Is this really just a disappointing case of "it's experimental, therefore it is buggy"?

  • Verified answer
    Lexicon_ Profile Picture
    189 on at

    I used a workaround with Flow. Instead of getting Canvas to clear out my date field, I added a Flow to do that.

     

    Flow configuration:

    Triggered by PowerApps

    Update a record (CDS)

    Record Identifier = Ask in PowerApps

    SubmittedDate = Null (under Dynamic Content → Expression)

     

    And then in Canvas, in my Button.OnSelect, in my Patch command, I removed SubmittedDate : Blank().

    Outside the Patch command I added ClearSubmittedDate.Run(varContactID);

    Where varContactID is the Record Identifier guid.

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 429 Most Valuable Professional

#2
11manish Profile Picture

11manish 191 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 122 Super User 2026 Season 2

Last 30 days Overall leaderboard