Skip to main content

Notifications

Power Apps - Microsoft Dataverse
Unanswered

Business Rule - Set Field value to current date time

(0) ShareShare
ReportReport
Posted on by 54

In Business Rules or Business Process Flows, is it possible to set a column value into the current date time?

 

I tried using a Formula Column to use UTCNow, however it's volatile and recalculates every time.

I would like to record the current date time to a field, and have it be static.
It's relatively simple in canvas apps using Patch, but is it possible in Model Driven Apps?

 

  • Ethan_009 Profile Picture
    Ethan_009 4,836 on at
    Re: Business Rule - Set Field value to current date time

    Hi @noelflores ,

     

    Couple of things that may help;

    1. CreatedOn does keep a note of the Date and Time of the record creation and will stay static always.

    2. In-case you need to store CreatedOn on some other DateTime or Date field then you can simply use BR/Flow/JS/Workflow/Plugin to populate the field with respective Data.

    3. If you are using BR, note it will trigger every time and stay active, so you need to keep a detection whether the custom field is Blank then set current time (You may encounter incorrect dates or invalid bcz your utc and local time may vary or the offset doesn't fall in proper range due to an offset).  

    4. Better way is to create a Flow that will trigger when record is created and then update the same record with utc() into your custom Field. (Note: CreatedOn is a system field cannot be modified so custom field is needed).

    5. You can try Plugin as well to update the records faster.

    6. JS is an option but I'd not recommend in-case you import your data, the date field won't be updated as JS requires context.

     

    Hope this helps

  • nwelflores Profile Picture
    nwelflores 54 on at
    Re: Business Rule - Set Field value to current date time

    Thanks, so I was thinking of using the Created On to calculate the difference from another date time value. 

    As in a powerfx patch statement: DateDiff(Created On, Now(), TimeUnit.Minutes) to get the duration in minutes.


    But, is it possible in a Business Rule/Business Process Flow?

     

     

     

  • Re: Business Rule - Set Field value to current date time

    Hi @noelflores ,

     

    You could use the 'Created On' field directly, which records when the record was created.

    vbofengmsft_0-1705633617681.png

     

    Best Regards,

    Bof

     

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

Microsoft Kickstarter Events…

Register for Microsoft Kickstarter Events…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Announcing Forum Attachment Improvements!

We're excited to announce that attachments for replies in forums and improved…

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 145,666

#2
RandyHayes Profile Picture

RandyHayes 76,287

#3
Pstork1 Profile Picture

Pstork1 64,996

Leaderboard

Featured topics