Skip to main content
Community site session details

Community site session details

Session Id : DkZromrWy0jWpBNt1qe7YK
Power Apps - Building Power Apps
Unanswered

Disable and Edit the text box based on the entry date in the PowerApp

Like (0) ShareShare
ReportReport
Posted on 28 Feb 2020 09:40:34 by 70

Hello,

Currently, I am unable to apply the "if" condition to disable and edit the text box based on the entry date in PowerApp.

Below is my scenario:-

 

Data in PowerApp screen

Forecasting date:- mm/dd/yyyy

1st Week:-

2nd Week:-

3rd Week:-

4th Week:-

 

Condition:- the displaymode for 1st Week data box should work as--- if the forecasting date is less than 7 then the 1st Week data box can be edited, in case the date is greater than 7 then the 1st Week data box should be disabled.

Similarly, for 2nd, 3rd and 4th Week data box the displaymode should work as 15,23 and 31 respectively in place of 7.

 

Note:- Forecasting date (DataCardValue21) and 1st Week (DataCardValue17)

 

Please find the snapshot and let me know if someone needs any more explanations.

Help me with the solution.

Thank you.

 

  

Categories:
  • Sumeesh Profile Picture
    70 on 05 Mar 2020 at 06:21:40
    Re: Disable and Edit the text box based on the entry date in the PowerApp

    Hello Daves,

    The below input showed me an error. (Please refer the snapshot)

    From 1st to 4th Week text box will have data in numericals and Forecasting date text box will be in date format. All the text box(1st to 4th Week) depend on Forecasting date value. 

    Note:- Forecasting date (DataCardValue14).

     

    for my case the 1st week text box should be in edit mode from 1st to 7th day of the month, rest all days the 1st week text mode should be disabled.

    ex:- from 1st to 7th March, the text box can be edited in displaymode and rest of the month in disable mode.

     

    for 2nd Week text box should be in edit mode from 7th to 14th day of the month, rest all days the 2nd week text mode should be disabled.

     

    for 3rd Week text box should be in edit mode from 15th to 21st day of the month, rest all days the 3rd week text mode should be disabled.

     

    for 4th Week text box should be in edit mode from 22nd to 31st day of the month, rest all days the 4th week text mode should be disabled.

     

    Let me know in case of any confusion or unclear part in my question.

  • Dawidvh Profile Picture
    1,346 on 02 Mar 2020 at 10:22:02
    Re: Disable and Edit the text box based on the entry date in the PowerApp

    Hi @Sumeesh 

     

    You can construct the dates with the Date function while adding 1 to the month value.

     

    If( Today() >= Date(
     Year(DateCardValue21.SelectedDate),
     Month(DateCardValue21.SelectedDate) + 1,
     1
     )
    
     && Today() <= Date(
     Year(DateCardValue21.SelectedDate),
     Month(DateCardValue21.SelectedDate) + 1,
     7
     ),
    DisplayMode.Edit,
    DisplayMode.View)

     

    Let me know if you don't come right.

     

    Dawid van Heerden
    Follow on Twitter: @davestechtips
    Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1
    **If you found this reply helpful, please like it and mark this as the answer to close the topic and make it easier to find for other people with similar questions. AND we get points for it 😉

  • Sumeesh Profile Picture
    70 on 02 Mar 2020 at 09:27:49
    Re: Disable and Edit the text box based on the entry date in the PowerApp

    Thank a lot Daves. It helped me.

    Can you help me with one more solution:-

    Case:- the 1st Week data entry should be editable if the forecasting data will be between 1 to 7th date of the month. (for ex:- 1st Week data entry should be editable from 1st to 7th March and disabled for later dates)

     

    Regards,

    Sumesh

     

  • Sumeesh Profile Picture
    70 on 02 Mar 2020 at 06:10:01
    Re: Disable and Edit the text box based on the entry date in the PowerApp

    1) data box- mean the entry box

    2) For example -

    Case:- if i select the forecasting data as 2nd Feb 2020 then the 1st Week should be editable and if i select the forecasting data as 8th March 2020 then the 1st Week should be disabled. 

    1st Week should be editable from 1st to 7th of every Month and later days should be in disabled DisplayMode.

     

    Hope this will clarify your doubts. Thank you

     

  • Dawidvh Profile Picture
    1,346 on 28 Feb 2020 at 14:47:10
    Re: Disable and Edit the text box based on the entry date in the PowerApp

    Hi @Sumeesh ,

     

    The following should work if entered into the DisplayMode Property of the text input.

     

    If(
     DateCardValue21.SelectedDate < DateAdd(
     Today(),
     -7,
     Days
     ),
     DisplayMode.View,
     DisplayMode.Edit
    )

     

    You can also use the DateDiff function instead of the DateAdd to determine how far past the date you have passed.

     

    Let me know if you don't come right.

     

    Dawid van Heerden
    Follow on Twitter: @davestechtips
    Subscribe to YouTube: https://www.youtube.com/davestechtips?sub_confirmation=1
    **If you found this reply helpful, please like it and mark this as the answer to close the topic and make it easier to find for other people with similar questions. AND we get points for it 😉

  • eka24 Profile Picture
    20,921 on 28 Feb 2020 at 11:22:29
    Re: Disable and Edit the text box based on the entry date in the PowerApp
    few clarifications:
    What is a data box.
    Forecasting day less than 7. Is it 7 days

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

Announcing our 2025 Season 2 Super Users!

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 637 Most Valuable Professional

#2
stampcoin Profile Picture

stampcoin 570 Super User 2025 Season 2

#3
Power Apps 1919 Profile Picture

Power Apps 1919 473