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 / Gallery - Only display...
Power Apps
Unanswered

Gallery - Only display Table Columns that are associated with another Table

(0) ShareShare
ReportReport
Posted on by 219

Hello,

 

I've been trying to work the below out for the past 3 days and i seem to be getting nowhere, so I'm coming to the Power Apps community for some guidance/help please.

 

I have 2 Dataverse Tables called:

 

Products:

Product_CodeProduct_NameCONVOrder_ConvFASTFOODOrder_TakeawayValue_Type
12345Coca-Cola 500mlTRUE20TRUE10Available
67890Monster Energy 500mlFALSE TRUE30Available
55555Dr Pepper 330mlTRUE10FALSE Number
21212Sprite 500mlTRUE30TRUE20Available

 

Audit:

IDAccount_NumberEnvironment12345678905555521212
194cf38c-5ac2-ee22-1234-000d2aad864f13412CONV1 10
194cf38c-5ac2-ee22-1234-000d2aad824f43256FASTFOOD11 1
194cf38c-5ac2-ee22-1234-000d2aad874f65433CONV0 11

 

What I'm trying to do is display a record from the Audit table within a Gallery, but only display Columns from the Audit table that are within the Products table.

 

For example, if we look at the first record in the Audit table then we can see the "Environment" is set as CONV, so here we want to load this record within the Gallery but only display the column names where they're within the Products table that have CONV set as TRUE.

 

So in that example to output would display

 

12345 = 1

55555 = 1

21212 = 0

 

I've managed to create a Gallery which pulls in the Products that match an Environment and have them display in order. But obviously this doesn't bring the current values of a record from the Audit.

 

 

If(
 varRecordID.Environment = "Convenience",
 Sort(
 Filter(
 Products,
 CONV = true
 ),
 Order_CONV,
 SortOrder.Ascending
 )
)

 

 

Below is an example I've created I'd like to have which ideally would work off the Audit record and display the values. I'm just a little lost on how best to do this. Any help would be greatly appreciated and thank you in advance.

 

CCEP_Mike_0-1707155614779.png

 

Categories:
I have the same question (0)
  • sgtsnacks64 Profile Picture
    322 Super User 2024 Season 1 on at

    You might have some issues achieving this with PowerFx, as column actions such as ShowColumns and AddColumns usually require literal text values to work (So they won't accept variables as input).

     

    You might however have better luck using Power Automate to do this, as you might have some more freedoms using the Select action and addProperty 😉

  • markinwaukesha Profile Picture
    91 on at

    DataVerse has improved but I also ran into the same issues when you want to have relationships between tables, 

    I eventually moved to SQL Server so I can have a view to fetch the values.    Instant flow route as sgtsnacks64 mentioned above would be an option by Passing in that selection and providing the filtering however the latency may be an issue because you'd have to kick off and wait for a flow -  

    If I had to tackle this I would:

    Similar to what you initially did, do but do a ClearCollect put those into a Collection  

    then I'd ClearCollect again to pull those from the Audit data --   once you have those two Collections you 

    have some flexibility on either trying to merge those based on your gallery 

    It's also nice for debugging because you can see them in the variables panel -   I've just usually put a button

    on a page to test it out easily to verify my collection is how I expect -  

    Maybe this gives you some ideas, but I think you're on the right track

     

     

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard