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 / Sql view into a galllery
Power Apps
Answered

Sql view into a galllery

(0) ShareShare
ReportReport
Posted on by 1,625

Hi

I have a SQL view, I am looking to use to pull data in to a gallery in a canvas app.

I was wondering how I can group the following:

 

e.g. I have 1 user who has around 20 jobs assigned to them, viewing the data 'as is' from SQL, this displays all the items as a separate record, i.e. 

User 1 - Job1

User1 - Job2

User1 - Job3

 

I would like to display all the jobs associated with user1, all the jobs with User2 etc.

 

Ideally I need to be able to search on these records too, not sure how possible this is? 

 

How can I do this?

 

Thanks

 

Categories:
  • timl Profile Picture
    37,314 Super User 2026 Season 2 on at

    Hi @Lefty 

    How many rows will your SQL View return? Will it be less than 2000?

    If so, you could set the Items property of a gallery control to this:

     

    GroupBy( YourSQLView, "UserNameColumn", "OtherColumns" )

     

    In your gallery, you can display the "UserNameColumn" in a label and add a nested gallery to display the other/user-job columns.

     

    To implement a search, you can apply the Search function on the view.

     

    GroupBy( Search(YourSQLView, 
     txtSearchInputBox.Text,
     "SearchColumn1",
     "SearchColumn2"
     ), 
     "UserNameColumn", 
     "OtherColumns" 
    )

     

     

     

  • Lefty Profile Picture
    1,625 on at

    Hi @timl 

     

    Thanks for this, gave me a a few ideas, but when I set up the function on my Items property of the main gallery I cant seem to get the syntax right:

     

    GroupBy(
     Search(
     SQLview,
     TextInpSearch_2.Text,
     "UserName", "GroupedDATA" //GroupedDATA is the remainder data from the SQLview
    )
  • timl Profile Picture
    37,314 Super User 2026 Season 2 on at

    @Lefty 

    The call to Search appears to be missing the target column(s). The following should hopefully take you further.

     

    GroupBy(
     Search(
     SQLview,
     TextInpSearch_2.Text,
     "TheColumnInYourSQLViewThatYouWantToSearchAgainst"
     )
     "UserName", "GroupedDATA" //GroupedDATA is the remainder data from the SQLview
    )

     

  • Lefty Profile Picture
    1,625 on at

    Hi @timl 

     

    the "TheColumnInYourSQLViewThatYouWantToSearchAgainst" is "UserName" that I want to search against

     

     

  • Verified answer
    timl Profile Picture
    37,314 Super User 2026 Season 2 on at

    @Lefty 

    In that case, the syntax would look like this:

    GroupBy(
     Search(
     SQLview,
     TextInpSearch_2.Text,
     "UserName"
     )
     "UserName", "GroupedDATA" //GroupedDATA is the remainder data from the SQLview
    )
  • Lefty Profile Picture
    1,625 on at

    Ah I see what you meant

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

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard