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 / Using created date and...
Power Apps
Answered

Using created date and time to make a field mandatory

(0) ShareShare
ReportReport
Posted on by 90

Hello,  

I have a question regarding the use of the created date to make a field mandatory.

 

so here is the situation.  We have a sharepoint list that is used to imput employee information and until now the field for department number has not been mandatory.  HR has now decided that field needs to be mandatory.  Which is all well and fine and simple to do.  However, when going back to add notes to older records, the form will now not save the info without the department field being completed.

This should be easy to do except that there are records that date back several years and we no longer know what department the employee was working in, unless we go to the Employee Master record which is time consuming and impractical.  Adding the current department is another option but then it will skew the data so we do not want to do that.

 

What I would like to do is,

on create,  the department # field should always be mandatory but,

on edit,  the department # field should only be mandatory for records created after August 22, 2022.  Basically I would like to use the "Created on" (date and Time) and say

"if the employee pay type is hourly and the record was created on or after August 22,2022, then department field is mandatory, otherwise it is not."  

 

I have tried several versions of if clauses, date diff formulae, etc. but nothing has worked.

 

Would anyone know how I could achieve this. 

 

Thanks 

 

 

 

 

 

 

Categories:
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @TJCappy 

    First off, you need to make sure the column is not required in your datasource.  If it is required there, then it doesn't matter what you change your app to, it will not submit.

     

    That said, you can alter the Required property of the datacard for department to be the following:

    ThisItem.Created > Date(2022, 08, 22)

     

    Now your statement: "if the employee pay type is hourly and the record was created on or after August 22,2022, then department field is mandatory, otherwise it is not." seems to imply more logic than just the created date, but the above is what you can use for the Required property based on the date part.  Would need to know more about the pay type information to include it in the formula.

     

    I hope this is helpful for you.

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 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard