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 return a spec...
Power Apps
Answered

distinct return a special value

(0) ShareShare
ReportReport
Posted on by 27

Hello

 

for a gallery i use

AddColumns(RenameColumns(Distinct(SortByColumns(Filter([@Gares];StartsWith(Title;TextSearchBox1.Text));"Title";If(SortDescending1;Descending;Ascending));Title);"Result";"Country"); "Photo"; SampleImage)

 

this from a sharepoint

MaximeGr_0-1675438077608.png

 

i want to replace SampleImage by the data "Image"

and how take the first image when i have more than 1 same City ?

For example you see Cherbourg 3 times but only one picture

 

Thanks

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

    @MaximeGr 

    For the Items property of the gallery:

     

    SortByColumns(
     Filter(
     GroupBy(
     Gares,
     "Title",
     "DATA"
     ),
     IsBlank(TextSearchBox1.Text) || 
     StartsWith(Title,TextSearchBox1.Text)
     ),
     "Title",
     Ascending
    )
    

     

    In your Gallery place a Label with the Text property: ThisItem.Title and an image control with its Image property::

    First(ThisItem.DATA).Picture

  • MaximeGr Profile Picture
    27 on at

    thanks

    i replace , with ; because in our version we don't use ,

     

    SortByColumns(
     Filter(
     GroupBy(
     Gares;
     "Title";
     "DATA"
     );
     IsBlank(TextSearchBox1.Text) || StartsWith(
     Title;
     TextSearchBox1.Text
     )
     );
     "Title";
     Ascending
    )

    and for the picture : First(ThisItem.DATA).Image

     

    Thanks 🙂

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Je t'en prie!Je t'en prie!

     

  • MaximeGr Profile Picture
    27 on at

    can i ask something else ?

    in the second screen how to find the City selected result ? (example Cherbourg)

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @MaximeGr 

    You can GroupBy(Gares, "Ville", "DATA") 

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @MaximeGr 

    You can GroupBy(Gares, "Ville", "DATA") 

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 551

#2
WarrenBelz Profile Picture

WarrenBelz 430 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 298

Last 30 days Overall leaderboard