cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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

@Anonymous

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
mdevaney
Super User III
Super User III

@Anonymous 

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."

eka24
Super User III
Super User III

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

Anonymous
Not applicable

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

@Anonymous 

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."

Anonymous
Not applicable

@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.

@Anonymous

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

Hi @Anonymous 

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 .

Anonymous
Not applicable

@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
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

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

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

Top Solution Authors
Top Kudoed Authors
Users online (10,795)