Notifications
Announcements
Hello,
Is there any way to set the "Date column" with todays date always. When the form is loaded ?
PFA
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
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 DateformContext.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/UCnGNN3hdlKBOr6PXotskNLABlog : 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.
In our never-ending quest to improve we are simplifying the forum hierarchy…
We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 739 Most Valuable Professional
Michael E. Gernaey 343 Super User 2025 Season 2
Power Platform 1919 268