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 Apps
Answered

PowerApps Dates

(0) ShareShare
ReportReport
Posted on by 789

Hello Everyone,

 

I have two DatePickers and I want the button to still be disabled when choose the dates on the DatePickers and I want the changes to remain when I use the app again.

If(Today()>=DatePicker1.SelectedDate && Today()<= DatePicker2.SelectedDate, DisplayMode.Disabled,DisplayMode.Edit)

 

I hope anyone can help.

 

@Amik @WarrenBelz   @ANB  @mmbr1606  @timl 

 

 

Categories:
  • WarrenBelz Profile Picture
    156,738 Most Valuable Professional on at

    Hi @Caleb62881177 ,

    What exactly do you mean by and I want the changes to remain when I use the app again.

    If you mean close and open it again, you will need to store these dates somewhere in a data source and get them back when you open the app - is this what you want to do ?

  • Caleb62881177 Profile Picture
    789 on at

    Hi  @WarrenBelz ,

     

    Sorry, I forgot to mention closing and reopening the app.

     

    Can the dates be stored locally or on a SharePoint List?

  • mmbr1606 Profile Picture
    14,629 Super User 2026 Season 1 on at

    Hey @Caleb62881177 

     

    Yes u would need to Store it somewhere like sharepoint, dataverse, sql or other datasource.

     

    Collections only last for the duration of a session and wont be there when u upen again.

     

    Let me know if my answer helped solving your issue.

    If it did please accept as solution and give it a thumbs up so we can help others in the community.



    Greetings

  • WarrenBelz Profile Picture
    156,738 Most Valuable Professional on at

    @Caleb62881177 ,

    You would have to use a SharePoint list.

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @Caleb62881177 - thanks for the private message but the advice here is right based on the information you have provided.

     

    If the solutions provided do not answer the question then you need to provide more context and detail.

  • Caleb62881177 Profile Picture
    789 on at

    Hi @WarrenBelz , I want to use a formula to store the two DatePickers selected dates in a SharePoint List and use that saved dates in the formula below to get the button's  Disabled based on the dates chosen in SharePoint.

     

    If(Today()>=DatePicker1.SelectedDate && Today()<= DatePicker2.SelectedDate, DisplayMode.Disabled,DisplayMode.Edit)

     

  • Verified answer
    WarrenBelz Profile Picture
    156,738 Most Valuable Professional on at

    Hi @Caleb62881177 ,

    Assuming you have a SharePoint List with two date fields (I will call them Date1 and Date2) with one record in it (can be empty to start) when you save them

    Patch(
     SPList,
     First(SPList),
     {
     Date1: DatePicker1.SelectedDate,
     Date2: DatePicker1.SelectedDate
     }
    )

    Then to get them back, all you need is

    First(SPList).Date1
    First(SPList).Date2

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • Caleb62881177 Profile Picture
    789 on at

    Hi @WarrenBelz , Thank you for all your help. Your solution worked to perfection.

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard