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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Dates within Gallery a...
Power Apps
Unanswered

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
    152,859 Most Valuable Professional on at

    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

    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

    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

    Hi @MithaliGupta 

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

    Kind Regards

    Chris

  • Verified answer
    WarrenBelz Profile Picture
    152,859 Most Valuable Professional on at

     

    @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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 759 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 310 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 228

Last 30 days Overall leaderboard