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

Searching diferent data

Hi there, 

 

I have a list in sharepoint with all the information of the clients. I created an application so that the sales team can consult necessary information. The search button that was created from the beginning, only searches by name of the company that is the first column. Is it possible to also search the name of the contact, telephone and email?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

Re: Searching diferent data

@Mike_Gzz

You are totally correct about using a TextBox.  Sorry about that 😞

 

Please try this code in the Items property of your gallery and replace the field names so they match your SharePoint list column names.

SortByColumns(
    Filter(
        [@ Clients];
        StartsWith(Title; TextSearchBox1.Text)
        Or StartsWith(Company; TextSearchBox1.Text)
        Or StartsWith('Customer Name'; TextSearchBox1.Text)
        Or StartsWith('Email Domain'; TextSearchBox1.Text)
    );
    "Title";
    If(SortDescending1; Descending; Ascending)
)  

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

8 REPLIES 8
Highlighted
Super User III
Super User III

Re: Searching diferent data

@Mike_Gzz 

More information is needed to give an answer here:

 

  • What datasource are you using?
  • What is the column type? (if SharePoint or Common Data Service)
  • What code have you used in the following ComboBox properties: DisplayFields, SearchFields, Items

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Super User III
Super User III

Re: Searching diferent data

Search(YouDataSource,SearchTextbox.Text,"Column1","Column2","Column3")

Highlighted
Helper III
Helper III

Re: Searching diferent data

hi @mdevaney 

 

I use a sharepoint list as datasource.

The type of column is text. In BrowseGallery SortByColumns (Filter ([@ Clients]; StartsWith (Title; TextSearchBox1.Text)); "Title"; If (SortDescending1; Descending; Ascending)) appears.

In the search text box, only "" appears.

 

appapp

Highlighted
Super User III
Super User III

Re: Searching diferent data

@Mike_Gzz 

I would accomplish this by changing the "SearchFields" property of your ComboBox to something like this.  Your field names might be different but this is the standard for Office365 users.

 

["CompanyName","DisplayName","Mail","TelephoneNumber"]


---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Helper III
Helper III

Re: Searching diferent data

@mdevaney  Thanks!

 

but I'm too lost ...

The search function is the default "TextSearchBox" is not a combobox.

I think I do not need a combobox, what I am looking for is that the seller can search by customer name, company or email domain. But the "TestSearchBox" only brings me the information of the company (because it is the first column). I've been looking at videos and forums, but I can't get it right.

Highlighted
Super User III
Super User III

Re: Searching diferent data

@Mike_Gzz

You are totally correct about using a TextBox.  Sorry about that 😞

 

Please try this code in the Items property of your gallery and replace the field names so they match your SharePoint list column names.

SortByColumns(
    Filter(
        [@ Clients];
        StartsWith(Title; TextSearchBox1.Text)
        Or StartsWith(Company; TextSearchBox1.Text)
        Or StartsWith('Customer Name'; TextSearchBox1.Text)
        Or StartsWith('Email Domain'; TextSearchBox1.Text)
    );
    "Title";
    If(SortDescending1; Descending; Ascending)
)  

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Highlighted
Super User III
Super User III

Re: Searching diferent data

Hi @Mike_Gzz 

First of all, Search() is not a delegatable function in SharePoint.  What that means is that if your list is >2k items, you will not return all of the items.  You will do better with using Filter() and StartsWith().  Please check out canvas-apps/functions/function-startswith  .for the proper syntax. 

For information on how to use these functions with multiple columns in the list see https://powerusers.microsoft.com/t5/Building-Power-Apps/Multiple-Search/td-p/57765 .

Highlighted
Helper III
Helper III

Re: Searching diferent data

@mdevaney 

Its works!!!!!!!!

 

I thank you too much!

 

Finally, I look for the first name of the contact and if the information appears to me. I try the last name and I don't see the result.

12.png13.png

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,131)