I was able to use the help of the posts above to solve my problem so I thought I would share my case and my outcome.
I had a similar problem where a user can select multiple building descriptions in a combo box and I want to display the associated building classifications. The combo box is linked to a sharepoint table. This is some basic data from the table
| Title | BuildingDescription |
| Class 1a | Private Residence |
| Class 1a | Duplex Residence |
| Class 1a | Town House |
| Class 1a | Terrace House |
| Class 1b | Boarding House |
I have a combo box named: pd-BuildingDescriptions. when the user selects these items below,
Terrace House
Town House
Duplex Residence
Private Residence
All of these types are of Class 1a.
I have used this formula to get the associated classes
TrimEnds(Concat('pd-BuildingDescriptions'.SelectedItems,Title &" "))
I am using three spaces to act as a delimiter so I can eaisly trim the last delimeter with TrimEnds.
This results in a string "Class 1a Class 1a Class 1a Class 1a"
The formula below provides only unique results of the building class
Set(varString,
Concat(
GroupBy(
Split(
TrimEnds(Concat('pd-BuildingDescriptions'.SelectedItems,TrimEnds(Title) &" "))
," "),
"Result","Results"),
Result & " ")
)
I built it by loading the variables below into a single line formula.
Set(varRepeatingString,
TrimEnds(
Concat('pd-BuildingDescriptions'.SelectedItems,Title & " ")
)
); //End Set varRepeatingString
Set(varDelimiter," "); // three spaces for my case
Set(
varString,
Concat(
GroupBy(
Split(
varRepeatingString,
varDelimiter
)//close split
,
"Result", //Apply grouping to this column name.
"GroupedColumnName" //Name of new column. Redundant
)//close groupby
,
Result & varDelimiter)//close concat
)//close set varString
The end result is varString = "Class 1a"
Thanks everyone for your contributions.