cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ntt56k4
Helper III
Helper III

Unable to filter my task status

Hi, 

 

I am unable to use the following code below to search and filter. I have a search text input names "searchname" and a combox names "comboboxtaskstatus". 

 

Code below here including filter won't work

 

Search(Filter(HelpDesk, IsBlank(comboboxtaskstatus.SelectedItems.Value) || IsEmpty(comboboxtaskstatus.SelectedItems) || TaskStatus = comboboxtaskstatus.Selected.Value), searchname.Text, "Title")

 

 

The code below will work for me if I remove the filter

 

Search(HelpDesk, searchname.Text, "Title")

 

Anyway know why? It appears it doesn't like equal sign and filter. 

 

 
 

filter.png

 

 

 

4 REPLIES 4
WarrenBelz
Super User III
Super User III

Hi @ntt56k4 ,

For syntax, a bit of a guess, but is TaskStatus a Choice field? Also you might try the below for the empty/blank test.

Search(
   Filter(
      HelpDesk, 
      (
         Len(comboboxtaskstatus.Selected.Value) = 0 || 
         TaskStatus.Value = comboboxtaskstatus.Selected.Value
      ), 
      searchname.Text, 
      "Title"
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi, 

 

your code seems to be working now as it only shows delegation warning and not an x error message. However, the items in my gallery are not recognizing anymore such as taskstatus, priority, and title. Before your code, those items work fine so I duno what is going on now. 

 

Text: ThisItem.TaskStatus.Value

Text: ThisItem.Priority.Value

Text: ThisItem.Title

 

ntt56k4_0-1613937254098.png

 

@ntt56k4 ,

Search is not Delegable, hence the warning.

I am not sure why the fields are not available (could you see them before?) as this is nothing more than a change of Filter syntax. If you do not want the Delegation warning and can make do with Title starting with the search, do this

Filter(
   HelpDesk, 
   (
      Len(comboboxtaskstatus.Selected.Value) = 0 || 
      TaskStatus.Value = comboboxtaskstatus.Selected.Value
   ) &&
   ( 
      IsBlank(searchname.Text || StartsWith(Title, searchname.Text) 
   )
)

I have just done a test here on exactly the same syntax and received all the fields in the gallery. What is the Items of your combo box and is it single or multi-select?

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

ntt56k4
Helper III
Helper III

Thanks again. Here is my full original code to search for title and description only, but I really need to be able to search or filter based on task status so I can view which tickets are open, in progress and closed. My combobox seems to be a multi select as I can select multiple items. 

 

If(isAdmin,SortByColumns(Search(HelpDesk,searchname.Text,"Title","Description"),"Created",If(ascendingOrder=true,Ascending,Descending)),Sort(Filter(AllTickets,'Created By'.Email = MyProfile.Mail || 'Created By'.Claims = MyProfile.UserPrincipalName ),Created,Descending))

 

pretty much I have a gallery that displays based on whether is a user or admin. I have the following collections below

 

Collect(AllTickets,HelpDesk);
Collect(TaskCategories,"General","Hardware Support","Network Support","Software Support","Website Support","Installation/Maintenance","IT Project","Purchase Request");
Collect(TaskStatus,"NOT STARTED","IN PROGRESS","COMPLETED");
Collect(TaskPriority,"HIGH","MEDIUM","LOW");
ClearCollect(AdminList,"atnguyen@washingtonea.org");
Set(MyProfile,Office365Users.MyProfile());
Set(RunFlow,false);

 

I have a collection AllTickets from my HelpDesk SharePoint list and I tried swapping HelpDesk to AllTickets and they both don't seem to work. 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (68,145)