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 / Update a Field with Cu...
Power Apps
Answered

Update a Field with Current DateTime via Button

(0) ShareShare
ReportReport
Posted on by 68

Hello everyone, happy to be here!

 

I'm new on PowerApps and I'm struggling with an issue for hours now.

I want to set a field value to the current date & time via button. This field is a table field and I want to update it for each row I'm pressing the button.

 

Here is my code:

 

 

Set(CurrentDateTime, Now());
Update(ThisItem.Submitted, CurrentDateTime);
Refresh(expenses)

 

 

And here is a screenshot to understand my issue better:

 

ndionysiadis_0-1672780090976.png

 

Thanks in advance!

 

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    155,283 Most Valuable Professional on at

    Hi @ndionysiadis ,

    You should just need

    Patch(
     SPListName,
     ThisItem,
     {Submitted: Now()}
    )

    and should not need to refresh.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • ndionysiadis Profile Picture
    68 on at

    Thank you for your anwer!

     

    This is what I'm getting as errors:

     

    1) The function 'Patch' has some invalid arguments.

    2) Invalid argument type (DateTime). Expecting a Record value instead.

    3) Cannot use a non-record value in this context: 'ThisItem.Submitted'.

     

    And this is the code:

    Patch(
     expenses,
     ThisItem.Submitted,
     {Submitted: Now()}
    )

    ndionysiadis_0-1672783673393.png

     

     

  • WarrenBelz Profile Picture
    155,283 Most Valuable Professional on at

    @ndionysiadis ,

    What type of field is Submitted - it should be date/time

  • ndionysiadis Profile Picture
    68 on at

    It is date/time

     

    ndionysiadis_0-1673269811797.png

     

  • ndionysiadis Profile Picture
    68 on at

    I've made it with this code:

     

    Patch(
     expenses,
     ThisItem,
     {Submitted: Now()}
    )

     

  • WarrenBelz Profile Picture
    155,283 Most Valuable Professional on at

    @ndionysiadis ,
    That is exactly what I posted in my first response

  • ndionysiadis Profile Picture
    68 on at

    I can't mark it as solution, why?

  • Verified answer
    WarrenBelz Profile Picture
    155,283 Most Valuable Professional on at

    @ndionysiadis ,

    I assume you managed to do so (it is now marked)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,009

#2
11manish Profile Picture

11manish 672

#3
Valantis Profile Picture

Valantis 628

Last 30 days Overall leaderboard