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 ! 😉
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,
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'."
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,
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,
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,
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.
WarrenBelz
146,743
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,079
Most Valuable Professional