web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to use search and ...
Power Apps
Answered

How to use search and add columns in filter

(0) ShareShare
ReportReport
Posted on by 243

I'm getting error when I try to use search and add columns together

 Filter(
 Search(
 '[GLOBUS_APP].[T5006_RETURNS_LOG]',
 TextSearchBox2.Text,
 "C5006_SENDER_NAME",
 "C5006_COMMENTS",
 "C5006_TRACKING_NUMBER",
 "C506_RMA_ID"
 ),
 AddColumns(
 '[GLOBUS_APP].[T5006_RETURNS_LOG]',
 "dateoffset",
 Text(
 DateAdd(
 C5006_RETURN_LOGGED_DT,
 TimeZoneOffset(),
 Minutes
 ),
 "[$-en-US]mm-dd-yyyy"
 ),
 DateValue(dateoffset) >= StartDate.SelectedDate,
 DateValue(dateoffset) <= EndDate.SelectedDate
 )
 )

How to change this code?

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

    @SumanKoduri 

    You're getting an error because your Filter syntax is incorrect.  Filter needs, DataSource and Conditions.  In your formula you are providing two data sources - not valid.

     

    Try this instead:

    AddColumns(
     Search(
     Filter('[GLOBUS_APP].[T5006_RETURNS_LOG]',
     DateValue(dateoffset) >= StartDate.SelectedDate,
     DateValue(dateoffset) <= EndDate.SelectedDate
     ),
     TextSearchBox2.Text,
    	 "C5006_SENDER_NAME",
    	 "C5006_COMMENTS",
    	 "C5006_TRACKING_NUMBER",
     "C506_RMA_ID"
     ),
     "dateoffset",
     Text(
     DateAdd(C5006_RETURN_LOGGED_DT, TimeZoneOffset(C5006_RETURN_LOGGED_DT), Minutes),
     "[$-en-US]mm-dd-yyyy"
     )
    )

     

    This will Filter your datasource by the date range, then search the results of that, then add the column dateoffset to the results of that.

     

    I hope this is helpful for you.

  • SumanKoduri Profile Picture
    243 on at

    it is showing error date value as invalid arguments 

     

    I tried like this 

    Filter(
     AddColumns(
     '[GLOBUS_APP].[T5006_RETURNS_LOG]',
     "dateoffset",
     Text(
     DateAdd(
     C5006_RETURN_LOGGED_DT,
     TimeZoneOffset(),
     Minutes
     ),
     "[$-en-US]mm-dd-yyyy"
     )
     ),
     DateValue(dateoffset) >= StartDate.SelectedDate,
     DateValue(dateoffset) <= EndDate.SelectedDate,
     TextSearchBox2.Text in C5006_SENDER_NAME || TextSearchBox2.Text in C5006_COMMENTS || TextSearchBox2.Text in C5006_TRACKING_NUMBER || TextSearchBox2.Text in C506_RMA_ID
    )
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @SumanKoduri 

    If you're using those dates for comparison, you might want to consider this formula instead:

    Filter(
     AddColumns(
     '[GLOBUS_APP].[T5006_RETURNS_LOG]',
     "dateoffset",
     DateAdd(
     C5006_RETURN_LOGGED_DT,
     TimeZoneOffset(),
     Minutes
     )
     )
     ),
     dateoffset >= StartDate.SelectedDate,
     dateoffset <= EndDate.SelectedDate,
     TextSearchBox2.Text in C5006_SENDER_NAME & C5006_COMMENTS & C5006_TRACKING_NUMBER & C506_RMA_ID
    )

     

    Also, tightened up the TextShearchBox bit in the filter.  Since you are || (Or'ing) each field, you might find it easier to just concatenate them all together and see if the search text is in the combined string.  Totally optional...

     

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 387

#2
timl Profile Picture

timl 340 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 301

Last 30 days Overall leaderboard