cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CYJ
Helper II
Helper II

Trying to concatenate values(not repeating) from collection and storing them into text.

Hello everyone, i have text value which is i split them before inserting into collection. After splitting them, i am trying to concatenate them and stored them into a text without repeating the same value

 

My text value:

CYJ_1-1592901958157.png

 

My button Function:

 

CYJ_0-1592901919280.png

 

Inside the collection,

CYJ_2-1592902178092.png

CYJ_3-1592902198350.png

 

I am trying to concatenate the values without repeating them and storing them into a text but i got the following error

 
 

concat.PNG

 
 
 
 

 

 

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
eka24
Super User III
Super User III

😀😀Sorry about that. Those are column and table names i use for my test. I have edited the post.

Tested with the following:

 

So expand your collection to:

Collect( Test4, { Company:Split(Label1.Text,"@").Result});
ClearCollect(Test5,Ungroup(Test4,"Company"))
 
Then Concat in the TextBox:
Concat(Test5,Result &",")
------------

If you like this post, give a Thumbs up. Where it solved your request,
Mark it as a Solution to enable other users find it.

View solution in original post

eka24
Super User III
Super User III

Revise it to:

ClearCollect( Test4, { Company:Split(TextInput5_3.Text,",").Result});
ClearCollect(Test5,Ungroup(Test4,"Company"));
ClearCollect(Test6,Distinct(Test5,Result))
 
or
ClearCollect( Test4, { Company:Split(Trim(TextInput5_3.Text),", ").Result});
ClearCollect(Test5,Ungroup(Test4,"Company"));
ClearCollect(Test6,Distinct(Test5,Result))
 
Then
Concat(Test6,Result &",")
 
------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
 

View solution in original post

20 REPLIES 20
eka24
Super User III
Super User III

Tested with the following:

Collect( Test4, { Company:Split(Label1.Text,"@").Result});
ClearCollect(Test5,Ungroup(Test4,"Company"))
 
Then Concat in the TextBox:
Concat(Test5,Result &",")
------------

If you like this post, give a Thumbs up. Where it solved your request,
Mark it as a Solution to enable other users find it.
Rahber
Super User II
Super User II

As easy way could be.

Concat(Distinct(CollectionName,ColoumnName),Result & ";")

 

 

Please accept it as a solution if it resolved your problem or up vote if it helped you in anyway!

Regards,

Rahber

Hi @eka24 ,

 

Why is there ice cream flavor? 🤣

Hi @Rahber ,

 

Tested your method but got the following red lines underneath the result.

 

CYJ_0-1592906493390.png

 

eka24
Super User III
Super User III

😀😀Sorry about that. Those are column and table names i use for my test. I have edited the post.

Tested with the following:

 

So expand your collection to:

Collect( Test4, { Company:Split(Label1.Text,"@").Result});
ClearCollect(Test5,Ungroup(Test4,"Company"))
 
Then Concat in the TextBox:
Concat(Test5,Result &",")
------------

If you like this post, give a Thumbs up. Where it solved your request,
Mark it as a Solution to enable other users find it.

View solution in original post

@eka24 ,

 

Thanks man. It worked

Rahber
Super User II
Super User II

Its because your Records are inside a record.

Since @eka24 has already given you the solution which is similar to mine the only difference is this code will not return the recurring values.

This is on my button
Collect(Test4, {company: Split(TextInput7.Text,",")} );
ClearCollect(Test5,Ungroup(Test4,"company"));

This is my new text field
Concat(Distinct(Test5,Result),Result & ";")
eka24
Super User III
Super User III

 

Hello @eka24 ,

 

 

Do you have any idea on how to not repeat the same value in the text? For example, in the collection, i have three values : "Company1", "Company2", "Company1"? In the text, i would like to have "Company1,Company2"

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

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (28,030)