web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Building Power Apps
Answered

Dates within Gallery and Form

(0) ShareShare
ReportReport
Posted on by 240

Hello,

 

1. I was wondering if it is possible to only have Month and Year visible within my Gallery and how to do this?

 

2. I also have a form that I would, if possible, want to add a restriction so that the 1st of the month must be selected and doesn't allow the form to be saved until this criteria is met, alternatively if it's possible to change within gallery any date selected within the form/date picker to the 1st of the month if another has been entered.

 

Appy1_0-1668098650691.png

 

Any help is very appreciated! I am new to Power Apps and getting there slowly!

 

Many thanks

Chris

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    151,631 Most Valuable Professional on at
    Re: Dates within Gallery and Form

    Hi @Appy1 ,

    OnChange of the Date Picker, put this

    UpdateContext({varDate: DateValue(Month(Self.SelectedDate) & "/1/" & Year(Self.SelectedDate))});
    Reset(Self)

    and the DefaultDate

    varDate

    No matter which day they pick, it will select the first of that month.

     

    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.

    Visit my blog Practical Power Apps

     

  • CC-19121430-0 Profile Picture
    240 on at
    Re: Dates within Gallery and Form

    Hi @WarrenBelz 

    Thanks for this, it is very close to working.

    I am in the UK so the date format isn't quite right, how would i change this to my regions date format?

    Many thanks

    Chris

  • MithaliGupta Profile Picture
    242 on at
    Re: Dates within Gallery and Form

    You may try setting variable like this

    UpdateContext({varDate: DateValue(Month(Self.SelectedDate) & "/1/" & Year(Self.SelectedDate))});
    Reset(Self)

    And this will return default value as month and year

  • CC-19121430-0 Profile Picture
    240 on at
    Re: Dates within Gallery and Form

    Hi @MithaliGupta 

    Thanks but that appears to be also providing the same US format.

    Kind Regards

    Chris

  • Verified answer
    WarrenBelz Profile Picture
    151,631 Most Valuable Professional on at
    Re: Dates within Gallery and Form

     

    @MithaliGupta .

    You have again repeated my post - I will always respond as my time zone permits (so please allow me to do this)

    @Appy1 ,

    You just need

    UpdateContext(
     {
     varDate: 
     DateValue(
     "1/" & Month(Self.SelectedDate) & "/" & Year(Self.SelectedDate)
     )
     }
    );
    Reset(Self)

     

    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.

    Visit my blog Practical Power Apps

     

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 686 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 433 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 266 Moderator

Last 30 days Overall leaderboard