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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to show different ...
Power Apps
Unanswered

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
    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,383 Super User 2025 Season 2 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 Super User 2025 Season 2 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard