cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Sort + Distinct + Search

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
1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Sort + Distinct + Search

Hi @TemsNC ,

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 Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

9 REPLIES 9
Highlighted
Community Champion
Community Champion

Re: Sort + Distinct + Search

Hi @TemsNC ,

 

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.

Highlighted
Frequent Visitor

Re: Sort + Distinct + Search

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
	)
Highlighted
Community Support
Community Support

Re: Sort + Distinct + Search

Hi @TemsNC ,

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,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Community Champion
Community Champion

Re: Sort + Distinct + Search

Hi @TemsNC ,

 

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.

Highlighted
Frequent Visitor

Re: Sort + Distinct + Search

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.

 

Highlighted
Community Support
Community Support

Re: Sort + Distinct + Search

Hi @TemsNC ,

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 Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted
Frequent Visitor

Re: Sort + Distinct + Search

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 ?

 

Highlighted
Frequent Visitor

Re: Sort + Distinct + Search

Hi,

 

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

 

Thank you

 

 

 

 

 

 

Highlighted
Community Champion
Community Champion

Re: Sort + Distinct + Search

Hi @TemsNC ,

 

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.

 

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,849)