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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patching a DateTime co...
Power Apps
Answered

Patching a DateTime column in Model Driven App Command Button

(0) ShareShare
ReportReport
Posted on by 47

Sorry I'm new to this. I'm trying to make a command bar button that will update (using the Patch function) a column in the record to the current date. From the videos and documentation I've found I thought this would be correct, but it is throwing an error. Invalid argument type. Expecting one of the following: ...

And putting "" around Today() like this, "Today()" gives the error that it is expecting datetime value but receiving a text value.

Putting DateValue("Today()") also doesn't work

OwenS28_0-1699667019675.png

 

Categories:
I have the same question (0)
  • Shaheer Ahmad Profile Picture
    2,194 Moderator on at

    Try:

    Text(Today())

    Or:

    Now()
  • Verified answer
    OwenS28 Profile Picture
    47 on at

    Alright I found what was wrong. It wasn't anything to do with the Patch function. I was trying to use two different formulas but I guess you can only use one formula in the model driven app command bar buttons. So what I did was make an If() function so that if the confirmation box is accepted, the record will patch. Otherwise it wont do anything to that column. Here is the code. And the youtube video I found that helped me, https://youtu.be/x4AKnyQjtYQ?si=dGMWUAJ5yIfZbgf-

     

    If(Confirm("Email customer that we received their shoes?", {Title:"Run Auto-Email"}), Patch(Orders, Self.Selected.Item, {'Received Shoe': Today()}))

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard