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 display message...
Power Apps
Answered

How to display message below DatePicker in PowerApps

(0) ShareShare
ReportReport
Posted on by 227

Hi,

 

I am using DataSource as Excel File. File contains columns such as Start Date,End Date,Reservation and other columns. I added label below DatePicker which display message when User selects Weekend days for reservation or when User selects the date that previous user reserved. As mentioned above,I would like to display message if reservation is canceled,so other user can reserve the date. Reservation column contains "Y", "N" ,"". I don't want to display message when Reservation column contains "Y". However, when Reservation contains "N" or " " , the message should be displayed.  I am not sure how to achieve this. I have below code in my Text property of the label.  

 

If(Text(DatePicker1.SelectedDate,"[$-en-US]dddd") = "Saturday" || Text(DatePicker1.SelectedDate,"[$-en-US]dddd") = "Sunday", "You can not sign in at sat or sun",If(Day(DatePicker1.SelectedDate) in col3.Value ,"Select an other date this is reserved",""))

 

Thanks in advance for your time and efforts!

Categories:
I have the same question (0)
  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Newbie12 ,

     

    Would you like to display different notifications in a Label based on the selected date's weekday and whether this date has been selected?

     

    If so, your formula has function mistakes:

     1\ The Weekday(Date) function would return a number which represents the weekday. And Day(Date) function would return the day value of the date, Day(Today()) returns 21, eg.

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-datetime-parts

     

    2\ Text(Date) function would convert the Date value to Text format:

    https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-text

     

    So, your formula would be:

     

    If(Weekday(DatePicker1.SelectedDate) = 7 ||Weekday(DatePicker1.SelectedDate) = 1, "You can not sign in at sat or sun",If(DatePicker1.SelectedDate in col3.Value ,"Select an other date this is reserved",""))

     

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

     

  • Newbie12 Profile Picture
    227 on at

    @v-jefferni,

     

    Thank your pointing out. I would like to mention that I built custom calendar using this link.The Dates in my Excel source is being saved as Text.I modified a question a little bit, as there was error during typing. Hopefully, it is clear now.

     

    Thanks,

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Newbie12 ,

     

    OK, I will look into that blog.

    Please feel free to let us know if you encounter any problem in PowerApps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

  • Newbie12 Profile Picture
    227 on at

    @v-jefferni,

     

    Great. Thank you! May be I should provide more details. The customize calendar was created using the blog, from there when user clicks on date customize calendar, It navigates them to signup Screen which contains Start Date,Enddate in Datepicker. The "Canceled" column is in Update status screen. When User updates  Canceled status"Y", "N" or empty value.No message should be displayed.

     

    col3 is collection of Start and End Date in above code

     

    Thanks in advance,

  • Verified answer
    v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @Newbie12 ,

     

    You mentioned that Date values in Excel are Text format, so I would like to know the creation of col3 collection.

     

    I suppose the col3 collection values are Text format date values, then the formula would be:

    If(Weekday(DatePicker1.SelectedDate) = 7 ||Weekday(DatePicker1.SelectedDate) = 1, "You can not sign in at sat or sun",If(Text(DatePicker1.SelectedDate,"[$-en-US]mmmm yyyy") in col3.Value ,"Select an other date this is reserved",""))

    The formats of col3.Value and the Date selected in DatePicker which converts to Text should be the same. So set "[$-en-US]mmmm yyyy") to the same as dates in col3.Value.

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

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 June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 366 Most Valuable Professional

#2
11manish Profile Picture

11manish 184

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 99 Super User 2026 Season 1

Last 30 days Overall leaderboard