cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Stacee
Frequent Visitor

Creating a search bar that searches a gallery for a lookup value

Hi Everyone,

 

I am trying to create a search bar that searches for a customers name in one gallery's table.  However in that table it is a lookup to the name, not actually the name.

The gallery shows the name as;

ThisItem.'Customer Name'.'Contact Name'

 

For the item field in gallery I have put

Search('Company - Invoices',TextInput3.Text,'Customer Name'.'Contact Name')

 

The customer name is in Company invoices Table which does a lookup for Contact Name is in the Contact Information table.

 

Please let me know if you require any other information.  Thank you.

2 ACCEPTED SOLUTIONS

Accepted Solutions
RandyHayes
Super User
Super User

@Stacee 

If that is the case, then your form is referring to your Galleryx.Selected for it's Item value.

Change your Gallery Items formula to the following:

DropColumns(
    Search(
        AddColumns('Company - Invoices',
            "_customerName", 'Customer Name'.'Contact Name'
        ),
        TextInput3.Text, _customerName
    ),
    "_customerName"
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

RandyHayes
Super User
Super User

@Stacee 

Absolutely!  That is what tells the Form what record to display or Edit.  If it is blank, then it will forever say "getting your data".

You can start by putting in : yourGalleryName.Selected

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

10 REPLIES 10
RandyHayes
Super User
Super User

@Stacee 

Consider the following to help:

Search(
    AddColumns('Company - Invoices',
        "_customerName", 'Customer Name'.'Contact Name'
    ),
    TextInput3.Text, _customerName
)

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Thank you very much for this.  I can now search! 😀

However it seems to have caused another problem.    If I click on the item in the gallery, (default (parent) icon), it will not show the contents in the form.  Also if I select my edit icon, (editform(form3)), it doesn't show up.  The only one that seems to work now for the form is the Newform(form3) icon.

 

Have you ever come across this before?

RandyHayes
Super User
Super User

@Stacee 

If that is the case, then your form is referring to your Galleryx.Selected for it's Item value.

Change your Gallery Items formula to the following:

DropColumns(
    Search(
        AddColumns('Company - Invoices',
            "_customerName", 'Customer Name'.'Contact Name'
        ),
        TextInput3.Text, _customerName
    ),
    "_customerName"
)
_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Hello 

 

thank you for all your help.  I did change it, but it still says no data when I select the person in the gallery and try and view or edit, although it still brings up their orders, which is great.  I had a little play, and I am sure that it is user error, but I just cant make it work. 

RandyHayes
Super User
Super User

@Stacee 

What is the Item property of your form?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

It is blank.  Am I supposed to put something in these?  

RandyHayes
Super User
Super User

@Stacee 

Absolutely!  That is what tells the Form what record to display or Edit.  If it is blank, then it will forever say "getting your data".

You can start by putting in : yourGalleryName.Selected

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Thank you for your help, feeling a little foolish at the moment.  So thank you also for your patience.  It works.  

RandyHayes
Super User
Super User

@Stacee 

No need to feel foolish.  There are a lot of parts that only time and experience will make crystal clear for you.  In the meantime...the forum is a great source of information.  

 

If you get some time, you might want to review over my video on Forms.  It is very long and comprehensive.  It also has a table of contents on it (in the description) that will let you just around and hone in on specific areas that you might need some guidance.

 

Also, if you are good now, please go back and find which message solved the problem and mark it as a solution so that others having the same issue can find a solution quickly.

 

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (1,598)