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 / Power Apps Default fun...
Power Apps
Answered

Power Apps Default function - Argument Defaults is inaccurate,expected a text variable

(0) ShareShare
ReportReport
Posted on by 143

Hey guys,

 

All the patches are failing ALL the time.  I finally figured out how to program the patch without errors, and now they will not patch the data to the appropriate list.  The error appears to be a run-time error, but I cannot see why it is happening. 

So I have been trying to follow these instructions:  https://www.matthewdevaney.com/power-apps-patch-function-error-handling/

But  I can't get it to work for the life of me.  The error exists with the Default line of the coding.  That is where the redstarts. It doesn't matter what I type after that line. It is an error.  When I hover over the red line, the error message in the subject line appears.

IsBlank(
 Validate(EMR_tblFinance_Timesheets_APP, 
 Defaults(EMR_tblFinance_Timesheets_APP),

 There is no need for single quotes because there are no spaces in the title of the list.

 

Thank you for your help.

Categories:
I have the same question (0)
  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @Tj7933,

    I think I have reproduced your issue.

    vqiaqimsft_0-1672106856629.png

    Here is the thing, the second parameter within the Validate() fucntion expects a column or a record, however in my test, I found that second parameter within the Validate() fucntion only expects a text literal which means it expects a column. Well we call the column name as a text literal, that's why you have this error message.

     

    Performance of Defaults() expression is slow because every time the Defaults() function is invoked, there is a call to the server where MyTable is stored.  The Patch() expression would then make at least two calls, one for the Defaults() and one for the Patch().

    To improve performance is to cache locally the return value of Defaults() in a global variable.  Then you can use the variable instead of Defaults() elsewhere in the app.

    Set(varRecord,Defaults(EMR_tblFinance_Timesheets_APP))

    Or you could directly use a blank record to replace the Defaults() function:

    Patch(EMR_tblFinance_Timesheets_APP,
     {ID: Blank()},
     {Column1: "xxx", Column2: "yyy"})
  • Tj7933 Profile Picture
    143 on at

    Thank you so much @v-qiaqi-msft .

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 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 136 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 109 Super User 2026 Season 2

Last 30 days Overall leaderboard