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 / Format date in a dropdown
Power Apps
Answered

Format date in a dropdown

(0) ShareShare
ReportReport
Posted on by 83

Hi,

 

I Have a PowerApp that manages Events, and the user must select the date of the event.

I can filter the event's date with my dropdown containing events, and it shows me the multiple different start date.

 

But there is the hour too, and I can't let it...

 

So I need : DD/MM/YYYY
But

It shows me : DD/MM/YYYY 00:00

 

How can I format this date ?

 

Thanks in advance ! 😉

Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Romsteck ,

    You can use the AddColumns() function to the datasource of the dropdown to add a formatted datetime and then select that column to show in the Dropdown. 

    AddColumns(datasource,"EDate",Text(EventDate,ShortDate))

     So if the column in the datasource is EventDate, then you can select Edate to show in the window of the dropdown control.

  • v-xida-msft Profile Picture
    on at

    Hi @Romsteck ,

    Do you want to format the date value within the Dropdown box?

    Could you please share more details about the formula you provided within the Items property of the Dropdown box?

     

    If you want to format the date value within the Dropdown box, I afraid that there is no direct way to achieve your needs. As an alternative solution, please consider take a try with the following workaround:

    Set the Items proprety of the Dropdown box to following:

    Filter(
     AddColumns(
     'YourDataSource',
     "FormattedDate",
     Text('Start Date', "dd/mm/yyyy") /* <-- 'Start Date' represents the Date type column you want to display in the Dropdown box */
     ),
     FilterColumn = ...
    )

    Then within your Dropdown box, set the "FormattedDate" column as Display column value. Set the Value property of the ComboBox to following:

    FormattedDate

     

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards,

  • Romsteck Profile Picture
    83 on at

    Hi,

     

    Thank you for your answers 😁

    Yes that's my problem.

     

    I tried your solution, and it formats the date in the dropdown.

     

    But there is another problem now :

    I cant filter the Gallery1 whith this dropdown, this value can't be evaluated by the filter...

     

    The original formula for the Items settings in the Dropdown2 is :
    Distinct( Filter( Events; Name = Dropdown1.Selected.Result ); 'Start Date' ) --> It's filtering with the event's name.

     

    And the filter for Gallery1 :
    SortByColumns( Filter( Invitations; Event.'Start Date' = Dropdown2.Selected.Result ); "rcr_name" )

     

    Do you have an solution to filter the gallery selecting the formated date ?

     

    Thanks 😉

    Best regards,

  • v-xida-msft Profile Picture
    on at

    Hi @Romsteck ,

    I have made a test on my side, please take a try with the following workaround:

    Set the Items property of the Dropdown2 to following:

    Distinct(
     Filter(
     AddColumns(Events; "FormattedDate"; Text('Start Date'; "dd/mm/yyyy"));
     Name = Dropdown1.Selected.Result
     ); 
     'FormattedDate'
    )

    Set the Items property of the Gallery1 to following:

    SortByColumns(
     Filter(
     Invitations; 
     Event.'Start Date' = DateValue(Dropdown2.Selected.Result) /* <-- Modify formula here */
     ); 
     "rcr_name"
    )

    Please consider take a try with above solution, check if the issue is solved.

     

    Best regards,

  • Romsteck Profile Picture
    83 on at

    Hi @v-xida-msft,

     

    Thank you for your reply.

     

    The DateTimeValue returns me a format that appears to be good, but I still can't filter the Gallery1...

     

     

    DateTimeValue(Dropdown2.Select.Result;"fr")

     

    Return : DD/MM/YYYY 00:00

     

    I see the following error :

     

    "A binary operator with incompatibles types was detected. Found Operand Types 'Edm.DateTimeOffset' and 'Edm.String' for operor kind 'equal'."

  • Verified answer
    v-xida-msft Profile Picture
    on at

    Hi @Romsteck ,

    Please consider take a try with the following workaround:

    Set the Items property of the Dropdown2 to following:

    GroupBy(
     Filter(
     AddColumns(Events; "FormattedDate"; Text('Start Date'; "dd/mm/yyyy"));
     Name = Dropdown1.Selected.Result
     ); 
     "Start Date",
     "FormattedDate",
     "GroupData"
    )

    then set the "FormattedDate" column as display value within Dropdown box.

     

    Set the Items property of the Gallery1 to following:

    SortByColumns(
     Filter(
     Invitations; 
     Event.'Start Date' = Dropdown2.Selected.'Start Date' /* <-- Modify formula here */
     ); 
     "rcr_name"
    )

     

    Please take a try with above formula, check if the issue is solved.

     

    Best regards,

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 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard