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 / Distinct function and ...
Power Apps
Unanswered

Distinct function and Gallery

(0) ShareShare
ReportReport
Posted on by 1,032

Hello everyone;

 

I have two tables "Audit" and "Result" . the user creates an audit then chooses a process and gives a score. An audit can contain several processes; In total we have 4 processes and each process has a standard image as a logo. when the user completes the audit; the information is stored in the "Result" table (as in the screenshot).
The Audit table data is displayed in gallery1 and in gallery 2 I want to display the chosen process names without reputation with the logos.
In the gallery2 item I entered:
Distinct(Filter(Result;IdAudit = Gallery1.Selected.IdAudit);Process)
which only gives me the chosen process names without reputation; How can I also have the logos at the same time with the process names to integrate it into gallery2?

Capture d’écran 2022-12-23 163549.png
Categories:
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @gikido 

    For the Items property of Gallery2

    GroupBy(Filter(Result;IdAudit = Gallery1.Selected.IdAudit),"Process","DATA")
    

    Inside the gallery, ThisItem.Process and First(ThisItem.DATA.yourlogo)

     

  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @gikido ,

     

    With the AddColumns function you can add a column to the return of the Distinct function which includes the Logo:

    AddColumns(
    	Distinct(
    		Filter(
    			Result;
    			IdAudit = Gallery1.Selected.IdAudit
    		);
    		Process
    	),
    	"Image";
    	LookUp(
    		Result;
    		Process = Result,
    		Image
    	)
    )

    In this case both the Data Source and the column name are the same, so that may cause an issue...

  • gikido Profile Picture
    1,032 on at

    @Drrickryp thank you 

     but it does't work when i try to write  First(ThisItem.DATA.yourlogo) for the controle image.

  • gikido Profile Picture
    1,032 on at

    @BCBuizer thank you

    I will change the name of the table. so I wouldn't have a problem. I have two more questions:
    if I use the addcolumn function will the column be added at the table level in the database? something else where i will put this code is that in item of gallery or in onvisible of page?

  • BCBuizer Profile Picture
    22,854 Super User 2026 Season 2 on at

    Hi @gikido , 

     

    The addcolumns function just adds a virtual column in the context of the control it is used in, so this doesn't change anything in your data source.

     

    This code is to be used for the Items property of Gallery2.

  • gikido Profile Picture
    1,032 on at

    @BCBuizer

    thank you for your reply; I'm a beginner in powerapps so you will find my questions trivial, I'm sorry, I'll try your solution ansd i will give you feedback

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
11manish Profile Picture

11manish 395 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 260 Most Valuable Professional

Last 30 days Overall leaderboard