cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
muralikrishna12
Helper IV
Helper IV

Concat function show many semicolons

Hi, 

I just have a ComoboBox to select Multiple items from a ComboBox

created collection to add selected Items from ComboBox,

when I try to assign to label that collection value

CollectionValues.Mail then it shows DataType: DataTable like an expected Text value

Then I tryed

Concat (CollectionValues, Mail&"; ")

but it shows below OutPut and it surprised me 

I selected only one item from the drop-down but it shows many semicolons along with the selected name.

 

 

muralikrishna12_0-1609962013939.png

 

how can I remove semicolons and get only selected items?

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@muralikrishna12 

So, your SearchUser function is going to return a table.  You are collecting all of those results.

I assume your Gallery1 TeamsUsers value is a list of just display names (i.e. not email addresses) and you are trying to get the email address for those names.

If so, consider the following change to your formula:

If(!IsBlank(Gallery.Selected.TeamsUsers), 
    ClearCollect(CollectionValues, 
        Filter(
            ForAll(Split(Gallery1.Selected.TeamUsers, ";"),
              {Name: Trim(Result),
               Mail: Coalesce(First(Office365Users.SearchUserV2({searchTerm:Trim(Result)}).value).Mail, Blank()) 
              }
            ),
            !IsBlank(Mail)
        )
    ) 
)

 

You will end up with a collection that has two columns, the original name and the first found email address for that name.  If no email is found, then the name is filtered out.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

3 REPLIES 3
RandyHayes
Super User III
Super User III

@muralikrishna12 

You appear to have blank records in your collection.

Please consider changing your Formula to the following:

Concat(Filter(CollectionValues, !IsBlank(Mail)), Mail & "; ")

 

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Hi @RandyHayes 

It seems like the issue is not while adding into the collection from Combobox to collection, 

Issue is 
When I edit that item/Record, that particular field values (which we have selected and updated from collection)

adding/Copying back in to collection here it is getting many semicolons along this submitted values 

here is the code 

If(!IsBlank(Gallery.Selected.TeamsUsers), 
  ForAll(Split(Gallery1.Selected.TeamUsers,";"), 
   Collect(CollectonValues, Office365Users.SearchUser({searchTerm:Result}))));

Can you help me how to avoid that semicolons 

RandyHayes
Super User III
Super User III

@muralikrishna12 

So, your SearchUser function is going to return a table.  You are collecting all of those results.

I assume your Gallery1 TeamsUsers value is a list of just display names (i.e. not email addresses) and you are trying to get the email address for those names.

If so, consider the following change to your formula:

If(!IsBlank(Gallery.Selected.TeamsUsers), 
    ClearCollect(CollectionValues, 
        Filter(
            ForAll(Split(Gallery1.Selected.TeamUsers, ";"),
              {Name: Trim(Result),
               Mail: Coalesce(First(Office365Users.SearchUserV2({searchTerm:Trim(Result)}).value).Mail, Blank()) 
              }
            ),
            !IsBlank(Mail)
        )
    ) 
)

 

You will end up with a collection that has two columns, the original name and the first found email address for that name.  If no email is found, then the name is filtered out.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

View solution in original post

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 (24,336)