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 / Enable fields dependin...
Power Apps
Answered

Enable fields depending on the date

(0) ShareShare
ReportReport
Posted on by 16

Hi,

 

I have a form field call "Reason for late submission" and I have another field call " Commissioning Date (dd/mm/yyyy)". I want to only allow user to key in the reason (enable the reason for late submission field) if the Commissioning Date is +14 days.

 

is this formula correct?

 

If(Text(ThisItem.'Commissioning Date(dd/mm/yyyy)*') > Text(DateAdd(Today(),14,TimeUnit.Days)),DisplayMode.View)

 

FARIDMD_0-1692689987625.png

 

TIA

Categories:
  • v-mingkz-msft Profile Picture
    Microsoft Employee on at

    Hi @FARIDMD,

    Does the Commissioning Date is a Date type?

    If so, you can set the Display Mode property of Text Input as following expression.

    If(ThisItem.'Commissioning Date(dd/mm/yyyy)*' < DateAdd(Today(),14,TimeUnit.Days),DisplayMode.Disabled)

     

    Best Regards,

    Kyrie

     

  • FARIDMD Profile Picture
    16 on at

    hello kyrie,

     

    the commissioning date is in text. Then i drag the date picker to overlap the commissioning date. is it the correct way to do it?

     

    FARIDMD_0-1692691272320.png

     

  • Verified answer
    v-mingkz-msft Profile Picture
    Microsoft Employee on at

    @FARIDMD,

    You can try to convert text to Date value.

    If(DateTimeValue(ThisItem.'Commissioning Date(dd/mm/yyyy)*') > DateAdd(Today(),14,TimeUnit.Days),DisplayMode.Disabled)
  • Martin Dráb Profile Picture
    14 on at

    You definitely should use Date data type (and likely the Date picker control) for the date. Then calculations and comparisons of dates are trivial. Using text makes everything much more complicated. If you wanted to use text anyway, the best approach would be converting it to a date as the first thing in the formula.

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 232 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 202 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard