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 / How to set date picker...
Power Apps
Unanswered

How to set date picker field as current date as default date, whenever user clicked on toggle control

(0) ShareShare
ReportReport
Posted on by 301

Hi , I have a canvas form in which I have a toggle control ,whenever the toggle is clicked or it’s value is true , I have to set date picker field as current date and that date field is view only field.

And I have used submitform function on Submit Button.

Basically filling all data card value and accepting term and condition (via toggle control) and Submitting the form data into SP list .

I have set defaultdate property of date picker as 

If(DataCardValueAgree.Value,vardate,Parent.Default) where vardate is local variable, value set to Now(),
But now all my records shows today date and not the actual date and sharepoint list has correct dates.
Categories:
I have the same question (0)
  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi @apeawakening,

     

    You can set your Toggle control OnCheck property to be:

    Set(setDate, Today())

     

    On the Date picker control on the DisplayMode property:

    If(Toggle1.Value = true, DisplayMode.View, DisplayMode.Edit)

     

    And for the DefaultDate property of the Date picker:

    setDate

     

    Please tick Accept as solution if the answer is useful.

    Thanks,

    @AARON_C 

  • Ape Awakening Profile Picture
    301 on at

    My Date picker field is read only field , it can have current date when user click on toggle control 

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    @apeawakening 

     

    Okay, so what are you trying to achieve then?

  • Ape Awakening Profile Picture
    301 on at

    Now the problem is now , when I view any previous record , the date field still shows today's date and not the date of day when this record was submitted 

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Okay. How are you previewing previous records? Are you selecting records from a gallery and displaying that record in a form?

  • Ape Awakening Profile Picture
    301 on at

    Yes , selecting from gallery and viewing in form

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    @apeawakening 

     

    Is the Items property of your form set to: Gallery1.Selected

  • Ape Awakening Profile Picture
    301 on at

    Ya ya, but the problem was with defaultselecteddate property of the date picker , which I found it .

    I have to set it according to my condition.
    Anyway thanks for your input and support.

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
WarrenBelz Profile Picture

WarrenBelz 345 Most Valuable Professional

#2
11manish Profile Picture

11manish 207 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 177

Last 30 days Overall leaderboard