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 / gallery with a list fr...
Power Apps
Answered

gallery with a list from SQL based on ID

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello,

I am working on a app and it is to register the fish that were caught. But they all go into one table and their ID is based on the project that's active. So in the table you have multiple rows of caught fish that need to be displayed. But not all the fish from the table. Just the fish that come from the one active project. Here is an example

1fishKindlength
2fishKindlength
2fishKindlength
2fishKindlength
3fishKind

length

So in the app I want a gallery that only displays the fish with the ID of 2. So the middle three. Can anyone help me? Thanks in advance.

Categories:
  • eka24 Profile Picture
    20,925 on at

    You can use Filter function to achieve that.

    On the Items property of Gallery:

    Filter (SQLtable,ID=2)

     

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Earlier in the app the "trajectId" is set. So in the gallery I use 

    Filter('[dbo].[Vangst]', trajectID = trajectId) and i get a error. It says invalid argument type

  • timl Profile Picture
    37,424 Super User 2026 Season 2 on at

    Hi @Anonymous 

    If trajectId is also the name of the column that you want to filter by in your table, I would name the variable something else (for example, varTrajectId) to avoid any conflict in naming.

    Also, can you confirm the language that you're using? If for example, you're using Dutch, you should use a semi-comma to separate the arguments in your calls to Set and Filter.

    Call to Set...

    Set(varTrajectId; 2)

    Call to Filter...

     

    Filter('[dbo].[Vangst]'; trajectID = varTrajectId)

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    yes it's dutch but we got an update so we also use commas. but let me try the variable thing

     

  • eka24 Profile Picture
    20,925 on at

    Can you show your variable code?

    ------------

    If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This is what i used to set that variable

    Set(varTrajectId, Patch('[dbo].[Traject]', Defaults('[dbo].[Traject]'), {projectID: projectID, trajectNummer: trajectNummer}));
  • Verified answer
    timl Profile Picture
    37,424 Super User 2026 Season 2 on at

    @Anonymous 

    I'm confused as to what you're doing here. Are you trying to add a new record into [dbo].[Traject], and to retrieve the primary key value of the record that you've just inserted?

    I suspect this is the formula that you're looking to use in your gallery.

    Filter('[dbo].[Vangst]'; trajectID = varTrajectId.trajectID)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    So when i set varTrajectId it retrieves the ID of the row. So i can link other table to it. I am going to try it

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 243 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 204 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 122

Last 30 days Overall leaderboard