cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AT_AlanTse123
Advocate I
Advocate I

Filter sharepoint list by datepicker selected date or text search box

Hi all,

I have TextSearchBox and datepicker and I want to use them to filter the SharePoint list called YT CDR List.

Just filter by text search box is fine but filter by datepicker Selected date is not work.

 

Below is my code on Browse gallery's Items but not work;

SortByColumns(Filter([@'YT CDR List'],StartsWith('Upload Time', DatePicker2.SelectedDate) ||StartsWith('Project No.', TextSearchBox1.Text)||StartsWith(OA, TextSearchBox1.Text)||StartsWith(Commence, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

 

Screen Capture:

AT_AlanTse123_0-1660228398625.png

 

How can i revise the code that can search by datepicker selected date or TextSearchBox ?

 

Thank you very much for your help.

1 ACCEPTED SOLUTION

Accepted Solutions

Filter by date:

SortByColumns(
	Filter(
		[@'YT CDR List'],
		'Upload Time' = DatePicker2.SelectedDate
	), 
	"Title", 
	If(
		SortDescending1, 
		Descending, 
		Ascending
	)
)

 

Try this filter instead:

SortByColumns(
	Filter(
                Search([@'YT CDR List'];TextSearchBox1.Text;"Project No.";"OA";"Commence"),
		'Upload Time' = DatePicker2.SelectedDate
	), 
	"Title", 
	If(
		SortDescending1, 
		Descending, 
		Ascending
	)
)

 

Please chekc the name of the fields and the , and ;

View solution in original post

8 REPLIES 8
Nogueira1306
Super User
Super User

SortByColumns(
	Filter(
		[@'YT CDR List'],
		'Upload Time' = DatePicker2.SelectedDate),
		StartsWith('Project No.', TextSearchBox1.Text),
		StartsWith(OA, TextSearchBox1.Text),
		StartsWith(Commence, TextSearchBox1.Text)
	), 
	"Title", 
	If(
		SortDescending1, 
		Descending, 
		Ascending
	)
)

Try that

 

If you need additional help please tag me in your reply and please like my reply.
If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,

Gonçalo Nogueira

Check my LinkedIn!

My website!

Hi Nogueira,

 

Thank you very much for your reply.

I tried your code but it has the error.

Would you please help to check?

Thank you.

 

AT_AlanTse123_0-1660266276731.png

 

SortByColumns(
	Filter(
		[@'YT CDR List'],
		'Upload Time' = DatePicker2.SelectedDate,
		StartsWith('Project No.', TextSearchBox1.Text),
		StartsWith(OA, TextSearchBox1.Text),
		StartsWith(Commence, TextSearchBox1.Text)
	), 
	"Title", 
	If(
		SortDescending1, 
		Descending, 
		Ascending
	)
)

Hi Nogueira,

Thank you very much for your reply.

Filter by date is work but it cannot filter by textsearchbox, Is it only can filter by one type in items property?

Also, May I know if only filter by date, how to revise the code?

Sorry for too much question.

Filter by date:

SortByColumns(
	Filter(
		[@'YT CDR List'],
		'Upload Time' = DatePicker2.SelectedDate
	), 
	"Title", 
	If(
		SortDescending1, 
		Descending, 
		Ascending
	)
)

 

Try this filter instead:

SortByColumns(
	Filter(
                Search([@'YT CDR List'];TextSearchBox1.Text;"Project No.";"OA";"Commence"),
		'Upload Time' = DatePicker2.SelectedDate
	), 
	"Title", 
	If(
		SortDescending1, 
		Descending, 
		Ascending
	)
)

 

Please chekc the name of the fields and the , and ;

Hi Nogueria,

Filter by date is work, thank you very much for your help.

But your second code is not work, i had change ; to :, it shows below error.

AT_AlanTse123_0-1660296119354.png

Thank you.

Itold you to check the names... It is not recognizing the "Porject No.".

 

Check the suggestions when oyu type Project and use that value. The problem is the collumn

Ok, thank you very much for your help.

I will check the name again.

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (1,231)