web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Powerapps Gallry Searc...
Power Apps
Unanswered

Powerapps Gallry Search using multible tables

(0) ShareShare
ReportReport
Posted on by 64

Hi,

      I am having a problem with the search on gallery, I have 3 tables and I need to search by text values not ID's.

The gallery code is as follows. This is looking at the Notes field, I need to search by either employee name or vanreg.

These values are in 2 other tables, tblEmployee and tblVandetails. These tables hold the unique ID which is stored in the main table tblVanjourneyLog.

SortByColumns(Search([@'[dbo].[tblVanJourneyLog]'], TextSearchBox1.Text, "Notes"), "Notes", If(SortDescending1, Descending, Ascending))

Each field on form has a lookup field as below.

LookUp('[dbo].[Employee]',employee_id = ThisItem.EmployeeID,Concatenate(employee_fname," ",employee_sname))

I need search routine to search by either employee name or vanreg as text not ID's.

 

Thanks in advance for any help on this.

Andy

 

Annotation 2020-01-02 112753.jpg
Annotation 2020-01-02 112705.jpg
Categories:
I have the same question (0)
  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @AndyRossco ,

    Do you want to filter tblVanJourneyLog based on either employee name or vanreg?

    Does tblEmployee have fields:employee_fname,employee_sname,employee_id

             tblVandetails have fields:vanreg,employee_id

             tblVanJourneyLog have field:EmployeeID?

    If so, try this formula:

    Filter(@'[dbo].[tblVanJourneyLog]',
     EmployeeID in Search(
     AddColumns(
     '[dbo].[tblEmployee]',"Name",Concatenate(
     employee_fname," ",employee_sname
     )
     ),
     TextSearchBox1.Text,"Name"
     ).employee_id
     ||
     EmployeeID in Search(
     '[dbo].[tblVandetails],TextSearchBox1.Text,"vanreg"
     ).employee_id
     )

     

     

     

    Best regards,

  • AndyRossco Profile Picture
    64 on at

    Hello v-yutliu-msft, Thank you so much for your reply.

     

    See below table relationships, As you can see the tblVanjourneyLog is main table pulling employee details and van details from related tables.

    I need to search or filter gallery by either employee ",Concatenate( employee_fname," ",employee_sname ) or Reg.

     

    Basically when user types in text into search text box it looks for similar text in these fields. So user can type Mike and it finds Mike Morgen etc, Or

    He types WA18 and finds anything associated with this reg number.

    Alternatively if this is too much , need search box to search by either employee or van reg. using separate search boxes.

     

  • AndyRossco Profile Picture
    64 on at

    Here is view of app.

    POWEAPPSVIEW.png
  • AndyRossco Profile Picture
    64 on at

    Here is view of SQL links

    Annotation 2020-01-06 091535.jpg

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 305 Most Valuable Professional

#2
11manish Profile Picture

11manish 212

#3
Valantis Profile Picture

Valantis 167

Last 30 days Overall leaderboard