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 / Showing data in a gall...
Power Apps
Answered

Showing data in a gallery when two different lists have same data

(0) ShareShare
ReportReport
Posted on by 320

Hi Team,

In my app, i have a situation where i want to show data in gallery when two different lists have the same number of data.

 

Scenario:

1.First list "Budget" contains TeamLeadName, Amount, Status columns.

2.Second list "Updated Budget" contains TeamLeadName, ExtraAmount, Status

 

Now when a particular person(Admin) logs into my app, i want to count the requests in "Budget"(First List) those have Distinct TeamLeadName, Approved Requests (Say 4). And if the same number of requests (Say 4) are logged in "Updated Budget" (Second List), Then i want to show these requests from "Updated Budget" (Second List) in a gallery to the Admin. 

 

Any suggestion will be helpful!!

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @abd3127,

    Could you please share a bit more about the Status column in your two SP lists? Is it a Choice type column?

    Do you want to display the same approved request (Say 4) from "Updated Budget" in a Gallery?

    Further, could you please share more details about the "same number of requests" that you mentioned?

    I suppose that the Status column is a Choice type column, is it true?

    If you just want to display the same approved requests (Say 4) from "Updated Budget" in a Gallery, I have made a test on my side, please take a try with the following workaround:6.JPG

     

    7.JPG

    Set the OnVisible property of the first screen of my app to following:

    Clear(RecordsCollection);
    ForAll(
     RenameColumns(GroupBy(AddColumns(Filter('20181227_case3', Status.Value="Approved"),"StatusValue", Status.Value),"TeamLeadName","StatusValue","GroupData"), "TeamLeadName","TeamLeadName1"),
     If(
     !IsBlank(LookUp('20181227_case3_1',TeamLeadName = TeamLeadName1 && Status.Value="Approved")),
     Collect(RecordsCollection, LookUp('20181227_case3_1',TeamLeadName=TeamLeadName1 && Status.Value="Approved"))
     )
    )

    On your side, you should type:

    Clear(RecordsCollection);
    ForAll(
     RenameColumns(GroupBy(AddColumns(Filter('Budget', Status.Value="Approved"), "StatusValue", Status.Value),"TeamLeadName","StatusValue","GroupData"), "TeamLeadName","TeamLeadName1"),
     If(
     !IsBlank(LookUp('Updated Budget',TeamLeadName=TeamLeadName1 && Status.Value = "Approved")),
     Collect(RecordsCollection, LookUp('Updated Budget',TeamLeadName = TeamLeadName1 && Status.Value="Approved"))
     )
    )

    Set the Items property of the Gallery to following:

    RecordsCollection

     

    If you want to display the approved requests (Say 4) from your "Updated Budget" (Second List) in a gallery only when the same number of requests (Say 4) are existed in your "Updated Budget" list, I have made a test, please take a try with the following workaround:

    Set the Items property of the Gallery to following:

    If(
    CountRows(GroupBy(AddColumns(Filter('20181227_case3',Status.Value="Approved"),"StatusValue", Status.Value),"TeamLeadName","StatusValue","GroupData")) = CountRows(GroupBy(AddColumns(Filter('20181227_case3_1',Status.Value="Approved"),"StatusValue", Status.Value),"TeamLeadName","StatusValue","GroupData")),
    GroupBy(AddColumns('20181227_case3_1',"StatusValue", Status.Value),"TeamLeadName","StatusValue","GroupData")
    )

    On your side, you should type:

    If(
     CountRows(
    GroupBy(AddColumns(Filter('Budget',Status.Value="Approved"),"StatusValue", Status.Value),"TeamLeadName","StatusValue","GroupData")
    ) =
    CountRows(
    GroupBy(AddColumns(Filter('Updated Budget',Status.Value="Approved"),"StatusValue", Status.Value),"TeamLeadName","StatusValue","GroupData")
    ), GroupBy(AddColumns('Updated Budget',"StatusValue", Status.Value),"TeamLeadName","StatusValue","GroupData") )

    Best regards,

    Kris

  • abd3127 Profile Picture
    320 on at

    Thanks @v-xida-msft

    This solution perfectly works for my scenario. The only change was that "TeamLeadName" was a person field and needed to be included in add columns,

    Now the formula that you gave to display data in gallery 

    If(
     CountRows(
     GroupBy(AddColumns(Filter('Budget',Status.Value="Approved"),"StatusValue", Status.Value),"TeamLeadName","StatusValue","GroupData")
     ) = 
     CountRows(
     GroupBy(AddColumns(Filter('Updated Budget',Status.Value="Approved"),"StatusValue", Status.Value),"TeamLeadName","StatusValue","GroupData")
     ), 
     GroupBy(AddColumns('Updated Budget',"StatusValue", Status.Value),"TeamLeadName","StatusValue","GroupData")
    )

     Shows data in grouped state and not the separate requests. I need to show the separate requests here according to the approved status.

    Can you suggest any ideas for this?

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

    Hi @abd3127,

    Could you please share a bit more about the "Separate request" that you mentioned?

    Do you want to only display the approved request from your 'Updated Budget' list?

    If you only want to display the approved request (rather than Groupded state) from your 'Updated Budget' list, please modify your formula as below:

    If(
     CountRows(
     GroupBy(AddColumns(Filter('Budget',Status.Value="Approved"),"StatusValue", Status.Value),"TeamLeadName","StatusValue","GroupData")
     ) = 
     CountRows(
     GroupBy(AddColumns(Filter('Updated Budget',Status.Value="Approved"),"StatusValue", Status.Value),"TeamLeadName","StatusValue","GroupData")
     ), 
     Filter('Updated Budget', Status.Value = "Approved") /* <- Modify here */
    )

    Best regards,

    Kris

  • abd3127 Profile Picture
    320 on at

    Hi @v-xida-msft

    Yes i want to show the approved requests here.

    The "separate Requests" that i mentioned are the different requests for each TeamLead in UpdatedBudget , Budget Lists.

    The scenario which i want here is like "TeamLead1" has 4 requests in Budget and UpdatedBudget. Then i need to show these 4 requests in a gallery.

    "TeamLead2" has 4 requests in Budget and 2 requests in UpdatedBudget, then i dont want to display these requests even if they are approved in both lists.

     

    Thanks

  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @abd3127,

    Just an update -- Please take a try with the following workaround:

    Set the OnVisible property of the first screen of your app to following formula:

    Clear(RecordsCollection);
    ForAll(
     RenameColumns(
    GroupBy(AddColumns(Filter('Budget',Status.Value="Approved"),"StatusValue", Status.Value),"TeamLeadName","StatusValue","GroupData"),
    "TeamLeadName", "TeamLeadName1"
    ), If( CountRows(GroupData) = CountRows(Filter('Updated Budget', TeamLeadName = TeamLeadName1, Status.Value = "Approved")), Collect(RecordsCollection, Filter('Updated Budget', TeamLeadName = TeamLeadName1, Status.Value = "Approved")) ) )

    Set the Items property of the Gallery control to following:

    RecordsCollection

    Best regards,

    Kris

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard