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

Re: Text search box

This si the filter i am using and i am want to search by department name, manager name and the title: 

 

If(IsMatch(admins.users,User().Email,Contains)=true, SortByColumns(Filter('Out of office (No approvals)',
StartsWith(Title, TextSearchBox1.Text)
, If(
Submitted=false && Approved=false && Declined=false && Cancelled=false,
true,
If(Submitted, 'Status of Request'.Value = "Submitted", false) || If(Approved, 'Status of Request'.Value = "Approved", false) || If(Declined, 'Status of Request'.Value = "Declined", false) || If(Cancelled, 'Status of Request'.Value = "Cancelled", false )
) ), "Title", If(SortDescending1, Descending, Ascending)), SortByColumns(Filter('Out of office (No approvals)', StartsWith(Title, TextSearchBox1.Text), If(Manager.Email = User().Email, Manager.DisplayName = User().FullName, Requester.DisplayName = User().FullName) , If(
Submitted=false && Approved=false && Declined=false && Cancelled=false,
true,
If(Submitted, 'Status of Request'.Value = "Submitted", false) || If(Approved, 'Status of Request'.Value = "Approved", false) || If(Declined, 'Status of Request'.Value = "Declined", false) || If(Cancelled, 'Status of Request'.Value = "Cancelled", false )
) ), "Title", If(SortDescending1, Descending, Ascending)))

 

 

 

I cannot use your formula because it gives error.

 

Capture.PNG

Tapesh
Level 8

Re: Text search box

Just wanted to know that i already have the item filed with this formula filter,

 

If(
StatusResult <> "All",
Filter(
'Petty Cash',
'Status ' = StatusResult
),
'Petty Cash'
)

 

And i want the search text box to search the filed with employee name from my SP List name Petty cash. i tried this as per your above solution but this does not seems to work for me.

 


i don't know why, will you suggest why is this so?

 

If(
StatusResult <> "All",
Filter(
'Petty Cash',
'Status ' = StatusResult
),
'Petty Cash'
) || SortByColumns(
Filter('Petty Cash', 
StartsWith('Employee Name ', TextSearchBox1.Text)), 
"EmployeeName", 
If(SortDescending1, Descending, Ascending))

 

it shows error., do you know why?

I have list name : Petty Cash in SPList,

Column in SpList: Employee name

And a Lable in my Gallery Items, which displays the Employee name.

@eka24 @iAm_ManCat @WarrenBelz 

eka24
Level 10

Re: Text search box

The error suggests delegation warning. Is your table more than 2000 rows. Otherwise go to settings and increase it to 2000. Is it sharepoint list?

If you like this post, give a thumbs up. Where it solved your issue, Mark as a solution
Super User
Super User

Re: Text search box

Hey @Tapesh,

 

I think this is more likely to work, could you give it a try?

 

SortByColumns(
   Filter(
      'Petty Cash',
      StatusResult = "All"
      ||
      'Status ' = StatusResult,
      TextSearchBox1.Text = ""
      ||
      StartsWith('Employee Name', TextSearchBox1.Text)),
   ), 
   "EmployeeName", 
   If(SortDescending1, Descending, Ascending)
)

 

 If it's not working, then please send back a screenshot of the error message you receive,

 

Thanks!

Sancho




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!
Tapesh
Level 8

Re: Text search box

Hi @iAm_ManCat 

 

Please find the error below as you said i tried the solution but seems like not working again. Display.pngDisplay2.png

eka24
Level 10

Re: Text search box

Based on the formula by @iAm_ManCat 
Remove the single  quotes on status. Are both StatusResult and Status ColumnNames?

'Status ' = StatusResult,

 

Tapesh
Level 8

Re: Text search box

Hi I tried this one it is some what working but the issue here now is, when i click on the different buttons, like All i do not see any data, when i click on pending i see all data, then on approve button as well it shows all data, and same on reject button shows all the data. 

 

 

SortByColumns(
Filter(
'Petty Cash',
StatusResult <> "All",
'Status' = StatusResult ||
TextSearchBox1.Text = ""
||
StartsWith('EmployeeName', TextSearchBox1.Text)), "EmployeeName",
If(SortDescending1, Descending, Ascending))

 

could you please let me know what part im doing wrong, i guess something which is related to filter .

eka24
Level 10

Re: Text search box

Please can you respond to my last reply
Tapesh
Level 8

Re: Text search box

Hi @eka24 

No just the status is the column name and other one StatusResult is variable, and i tried as you said but does not seems to be working 

Highlighted
Super User
Super User

Re: Text search box

Hi,

 

I can see from your screenshot that you got rid of the Sort Ascending/Descending button on that screen, so that part of the formula will no longer work correctly. Also you have modified the code I gave to an incorrect form, your code now only checks if the StatusResult is not equal to "All". and then displays all items

 

SortByColumns(
Filter(
'Petty Cash',
StatusResult <> "All",
'Status' = StatusResult ||
TextSearchBox1.Text = ""
||
StartsWith('EmployeeName', TextSearchBox1.Text)), "EmployeeName",
If(SortDescending1, Descending, Ascending))

It needs to be something like this:

SortByColumns(
   Filter(
   'Petty Cash',
   
   // here we are saying that the status variable must be "All",
   // which will then not filter any items, or else the status must match the variable
   StatusResult="All" || 'Status ' = StatusResult,
   
   // here we are saying, the textbox text is a blank or else it must
   // additionally filter the above by EmployeeName based on the Textbox Text
   TextSearchBox1.Text = "" || StartsWith('EmployeeName', TextSearchBox1.Text)
   ),
"EmployeeName",
If(SortDescending1, Descending, Ascending)
)

Can you try something like this and then if it does error, hover your mouse over the error so that we can see the error message details, thanks.

 

Can you also please paste here the code you are using on each of your status buttons,

 

Thanks,

Sancho




Don't forget to 'Mark as Solution' if a post answered your question and always 'Thumbs Up' the posts you like or helped you!

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (3,974)