Asha Richardson
Asha Richardson

Reputation: 29

PowerApps Filter Gallery with DatePicker

Trying to add a filter to a gallery based on datepicker from a sql datasource. The date format is YYYY-mm-dd.

When I add a filter to the a SQL datasource gallery and I add a datepicker to allow me to filter the records on date. SQL displays the date as YYYY-MM-dd. Datepicker is showing date as MM\dd\YYYY. When I enter a date that I know I have data for, no data is display. I don't get an error in the formula.

Formula for Gallery.items:

Filter(
    vw_Expenses, 
    Date = dp_ViewExpensesDateFilter.SelectedDate
)

Nothing is displayed. Is it because SQL displays dates as YYYY-MM-dd? If so, how do I fix this? If not, what is the recommended change to get the filter working on my gallery?

Upvotes: 0

Views: 2971

Answers (1)

SeaDude
SeaDude

Reputation: 4405

Check the data type on the SQL column. It could be text or DATE, etc.

The DatePicker control in PowerApps is of Date type:

enter image description here

  • Notice the , 12:00:00 AM appended

By rapping it in the Text() Function, you can change it to Text:

enter image description here

You need to match up the DataSource (SQL) and the PowerApps data types to get the Filter function to work.

Upvotes: 1

Related Questions