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 / Sort + Distinct + Search
Power Apps
Answered

Sort + Distinct + Search

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi

 

I try to retrieve a list of customer from a gallery with a search in which I would like to use a distinct.

I did not found an answer about it. And , I don't know if it's possible to do it like that

 

Sort(
Distinct(
Search(
Table1;
REC_BASE_CLIENT_SAISIE.Text"CLIENT_NOM"
);
Table1
);
CLIENT_NOM
)
 
Thank you for your help
Categories:
I have the same question (0)
  • KrishnaV Profile Picture
    5,023 on at

    Hi @Anonymous ,

     

    Try this:

    Sort(Distinct(Search(Table1,REC_BASE_CLIENT_SAISIE.Text, "CLIENT_NOM"),CLIENT_NOM),CLIENT_NOM,Ascending)


    I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

    Regards,
    Krishna
    If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you for your email

     

    I had to replace , by ; but it did not work

     

    Sort(
    	Distinct(
    		Search(
    			Table1,REC_BASE_CLIENT_SAISIE.Text, "CLIENT_NOM"
    				),CLIENT_NOM
    			),CLIENT_NOM,Ascending
    	)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

    Based on the formula that you mentioned, I think there is something wrong with it.

     

    Please consider modify your formula as below:

    Sort(
     Distinct(
     Search(
     Table1;
     REC_BASE_CLIENT_SAISIE.Text; 
     "CLIENT_NOM"
     );
     CLIENT_NOM
     );
     Result; // Type Result formula here
     Ascending
    )

     

    Please consider take a try with above solution, then check if the issue is solved.

     

    Best regards,

  • KrishnaV Profile Picture
    5,023 on at

    Hi @Anonymous ,

     

    I am able see the result without any issues for you I have I have a created working model with the below formula:

    Sort(
     Distinct(
     Search(
     SampleList,
     TextInput21.Text,
     "Title"
     ),
     Title
     ),
     Result,
     Ascending
    )

    Working model:
    Sort + Distinct + Search.gif


    I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

    Regards,
    Krishna
    If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi, Sorry for the delay. Thank you for your email.

    The request works but I can't retrieve the value in my form

     

    3.png

     

    5.png

     

    I suppose I need to use .Result but it seems I forget something.

     

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

    Hi @Anonymous ,

    Have you try the following formula within your Gallery Items property?

     

    Sort(
     Distinct(
     Search(
     Table1;
     REC_BASE_CLIENT_SAISIE.Text; 
     "CLIENT_NOM"
     );
     CLIENT_NOM
     );
     Result; // Type Result formula here
     Ascending
    )

    According to the issue that you mentioned, I think the above formula could achieve your needs. Please set the Items property of the Gallery to above formula.

     

    Within your Gallery, please set the Text property of the Label to following:

    ThisItem.Result

    Note: Because, you have applied the Distinct function to your Search result, you could only reference the Result column value inside your Gallery. 

     

    If you also want to display related "TELEPHONE" column value in your Gallery, please consider try the following workaround:

    Add another Label inside your Gallery, set the Text property to following:

    Concat(
     Filter(Table1; CLIENT_NOM = ThisItem.Result);
     TELEPHONE & "; "
    )

     

    Please try above solution, check if the issue is solved.

     

    Best regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi

    Thank you for your answer. It works perferctly and I understand better the process.

    Regarding a dropdown list, I need to show the record which is true or false

     

    Concat(
     Filter(Table1; CLIENT_NOM = Text(Gallery2_1.Selected.Result));LOYALTY_NUMBER
    )

     

    What do I need to modify for a boolean value to show ?

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi,

     

    I would like to know how I can get only one result in the datacardvalue from the concat formula.

     

    Thank you

     

     

     

     

     

     

    Concat - Multiple result.png
    Concat - Multiple result 2.png
  • KrishnaV Profile Picture
    5,023 on at

    Hi @Anonymous ,

     

    try this:

    Contact(First(Filter(Tabel1,Client_Nom=Text(Gallery2.Selected.result)),Telephone)

     
    I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

    Regards,
    Krishna
    If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more.

     

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 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard