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 / How to set date column...
Power Apps
Unanswered

How to set date column with default date

(0) ShareShare
ReportReport
Posted on by 223

Hello,

 

Is there any way to set the "Date column" with todays date always. When the form is loaded ?

 

PFA

 

 

I have the same question (0)
  • Drew Poggemann Profile Picture
    9,287 Most Valuable Professional on at

    Hi @skolisetti ,

     

    Please see the following (https://powerusers.microsoft.com/t5/Microsoft-Dataverse/Default-Dates-in-Model-Driven-App-forms/td-p/469512) as this would need to be done with JavaScript.

     

    Hope this helps.  Please accept if answers your question or Like if helps in any way.


    Thanks,


    Drew

     

     

  • Ram Prakash Duraisamy Profile Picture
    5,593 Super User 2025 Season 2 on at

    Hello @skolisetti,

     

    You can use below code

     

    1. Login to https://make.powerapps.com

    2. Expand Tables

    3. Open the Form from the required Table

    4. Then Click on Events --> Select OnLoad--> then Select New WebResource --> Create a WebResoure--> Paste the code which i mentioned

    5. Then in onLoad Operation set the Function as SetToday make sure you selected Execution Context checkbox is selected

    6. Save and Close then Publish

     

    function SetToday(executionContext) {
    var formContext = executionContext.getFormContext();
    if (formContext.ui.getFormType() == 1) {
    formContext.getAttribute(FIELDLOGICALNAME).setValue(new Date()); // new Date is for Setting current Date
    formContext.getAttribute(FIELDLOGICALNAME).setSubmitMode("always"); // if field is disabled we can use Always to set the value
    }
    }

     

    Please mark as Answer if it is helpful and provide Kudos


    Subscribe : https://www.youtube.com/channel/UCnGNN3hdlKBOr6PXotskNLA
    Blog : https://microsoftcrmtechie.blogspot.com

     

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard