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.
how can I remove semicolons and get only selected items?
Solved! Go to Solution.
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.
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.
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
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.
User | Count |
---|---|
195 | |
123 | |
86 | |
48 | |
40 |
User | Count |
---|---|
281 | |
165 | |
139 | |
80 | |
76 |