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 / 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:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,051 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
    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

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