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 / Set Date Variable and ...
Power Apps
Answered

Set Date Variable and Update Date/Time Field Value based on a specific scenario

(0) ShareShare
ReportReport
Posted on by 48

Hi,

 

Is there anyone here who knows how to properly set Date/Time variable?

 

Currently I am using Set(varLMApprovalDate, Blank()) but it doesn't get accepted when I put varLMApprovalDate on my date field Default value.

 

Also, once entry is saved, there are some instances where I have to update the date field value to Now();

Note: Variable is then set to Set(varLMApprovalDate, {Value: Now()}) and I also tried below:

 

Set(varLMApprovalDate, DateValue(DateValue3.Now() + Time(Value(HourValue3.Now()), Value(MinuteValue3.Now()),0)));

 

Any suggestions?

 

Regards,

-K

Categories:
  • WarrenBelz Profile Picture
    156,532 Most Valuable Professional on at

    Hi @KMagadia ,

    Try enabling Formula Level Error Management as below and try again.

    FormulaLevelErrorManagement.jpg

     

    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.

  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @KMagadia :

    Do you want to create a variable named varLMApprovalDate whose value is datetime type?

    Firstly,I want to point out some of the following formulas that I think are not reasonable.

     

    Set(varLMApprovalDate, {Value: Now()})

     

     The point is {Value: Now()} is a record instead of a datetime type value.

    Secondly,I suggest you try this code(Delete the three formulas you mentioned and use the formulas below😞

     

    Set(varLMApprovalDate, Now())

     

    Best Regards,

    Bof

  • KMagadia Profile Picture
    48 on at

    Hi @v-bofeng-msft 

     

    As suggested, I set my variable to:

     

    Set(varLMApprovalDate, Now())

     

     

    And then I updated my DateDataCard's default property value to:

     

     

    Text(varLMApprovalDate, "[$-en-US]mm/dd/yyyy hh:mm:ss")

     

     

    Having these 2 setup, I manage to get my stuff done.

     

    Thanks for your help! 🙂

     

    Regards,

    -K

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
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard