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 / How to show different ...
Power Apps
Suggested Answer

How to show different datasource columns in a gallery?

(0) ShareShare
ReportReport
Posted on by 103

Hi Experts,

I have added SQL Server as a connection to my powerApp and added two tables as data sources to my app.

In that two tables one is header table and another is line table.

I created a gallery to my powerApp. For each record 5 columns need to show. In that,

1. The journal number in header table.

2. Journal name in header table.

3.Currency code and sum of amount these two columns are from line table.

4. Account number in the line table.

Journal number is the unique id in the header table and for one journal id multiple lines in the line table.

I need help for 3 & 4 columns and need to filter the gallery based on journal number and column 4.

whether i need to use filter inside another filter or any other?

Please can anyone help me to solve this by suggest formulas.

Thanks,

with regards,

User237.

Categories:
I have the same question (0)
  • Vijay Tailor Profile Picture
    2,961 on at

    Hi @User237 

    as per my understanding, you need to use Join functionality.

    for that, you can check the below URL , Hope this solution help you to resolve your issue.
    https://powerusers.microsoft.com/t5/Building-Power-Apps/join-two-sql-tables/m-p/348783#M100124

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

  • v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @User237 ,

    Could you show me the structure of the two tables?

    From your description, do you have these fields in your two tables?
    1)you have fields named  journal number, Journal name in header table;

    2)you have fields named Currency code, sum of amount, Account number in the line table.

    Do you want to filter the gallery based on  journal number and Account number?

    Could you tell me:

    1)the relationship between the two tables?

    2)formula in the gallery's Items?
    3)the filter rule?

    Based on your description, I do not quite understand your filter rule.

     

     

    Best regards,

  • agorkemt Profile Picture
    73 on at
    Hey there,
     
    If you still looking for a solution maybe you can try 'lookup' function and in your gallery, for each control you can use this lookup function and retrieve data from sql server for each gallery control. I tried something similar to this but it was a form, not a gallery and it worked. 
     
    You can also watch this video from Shane Young, too. the syntax etc, it explains real simple;
     
    Have a nice day!
  • timl Profile Picture
    36,774 Super User 2026 Season 1 on at
    Hi User237,
     
    An efficient way to do which would be delegable is to create a view in SQL Server that joins the header and line tables. You would then add the view to your Power App and use that as the data source for your gallery. 
     
    The SQL for the view would look like this:
     
    CREATE VIEW JournalSummary AS
    SELECT 
        h.JournalNumber,
        h.JournalName,
        l.CurrencyCode,
        SUM(l.Amount) AS TotalAmount,
        l.AccountNumber
    FROM 
        HeaderTable h
    INNER JOIN 
        LineTable l ON h.JournalNumber = l.JournalNumber
    GROUP BY 
        h.JournalNumber, 
        h.JournalName, 
        l.CurrencyCode, 
        l.AccountNumber;
     
     
     
     
  • Suggested answer
    CA1105 Profile Picture
    545 Moderator on at
    You can use Join in SQL servers to combine the 2 table data but also you can easily do 'Lookup' function in your add with both the sources.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard