cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Saego
Level: Powered On

Search Date with Searchbar for gallery

 Hi,

 

So I have a search bar where users can type in a vessel to find the vessel they need.  I also want users to search a date so they can find that specific date they need.

 

The Item property for gallery is: 

SortByColumns(Search( '[dbo].[tbl_Dailynoon_Report]'; txtSearch_NoonReport.Text; "Vessel"; "Date"); "Date"; If(SortDescending1; Descending; Ascending))

 

This doesn't work, sadly. The column "Date" is the problem, because when I remove it, the searchbar works. Probably has something to do that "Date" isn't in Text, but I don't know how to fix that. 

 

I'm using SQL as a source, don't know if that matters.

 

Thanks for the help.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Search Date with Searchbar for gallery

Hi @Saego

 

Could you please share a bit more about your SQL Table data source within your app?

Which type of the Date column in your SQL table? Is it a Date only type or DateTime type column?

 

The Date type from SQL Server can't work with PowerApps (a known issue), if possible, please switch to DateTime type. Please check the following thread:

https://powerusers.microsoft.com/t5/General-Discussion/Filter-and-Lookup-not-working-with-date-value...

 

I have made a test on my side, if you want to filter the records of your SQL table based on the date or the vessel that you typed within the TextInput control (search bar), I afraid that there is no way to achieve your needs in PowerApps currently.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Community Support Team
Community Support Team

Re: Search Date with Searchbar for gallery

Hi @Saego

 

Could you please share a bit more about your SQL Table data source within your app?

Which type of the Date column in your SQL table? Is it a Date only type or DateTime type column?

 

The Date type from SQL Server can't work with PowerApps (a known issue), if possible, please switch to DateTime type. Please check the following thread:

https://powerusers.microsoft.com/t5/General-Discussion/Filter-and-Lookup-not-working-with-date-value...

 

I have made a test on my side, if you want to filter the records of your SQL table based on the date or the vessel that you typed within the TextInput control (search bar), I afraid that there is no way to achieve your needs in PowerApps currently.

 

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Saego
Level: Powered On

Re: Search Date with Searchbar for gallery

Hi @v-xida-msft,

 

Thank you for the quick answer. Yes, it's the type 'Date' so not 'DateTime' in SQL.

I'll try to change it to DateTime and I'm going to check if that works. 

Thanks for the help. 

Saego
Level: Powered On

Re: Search Date with Searchbar for gallery

So I changed it and have two problems now.

In SQL, the datetime for a certain field is now 2018-01-01 00:00:00.000, while in Powerapps it's 2018-01-1 01:00. 

Is there a way to only show the date in Powerapps?

 

Then the second: 

My formula for Items Gallery is now:

SortByColumns(Search( '[dbo].[tbl_Dailynoon_Report]'; txtSearch_NoonReport.Text; "Vessel"; "Date"); "Date"; If(SortDescending1; Descending; Ascending))

 

It still doesn't work. I'm sure that I need to convert the "Date" from DateTime to text in Powerapps, but I don't know how.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,920)