cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TemsNC
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

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
KrishnaV
Super User III
Super User III

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.


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,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
TemsNC
Frequent Visitor

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

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.

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.


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,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.
TemsNC
Frequent Visitor

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.

 

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

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 ?

 

Hi,

 

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

 

Thank you

 

 

 

 

 

 

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.

 


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,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (39,616)