I would like to populate a Combobox choice options with DISTINCT values from two Text Value columns in the same SP list and sort them as shown below.
ColumnA | ColumnB |
3-CCC | 1-AAA |
3-CCC | 5-EEE |
4-DDD | 3-CCC |
2-BBB | 4-DDD |
3-CCC | 5-EEE |
10-JJJ | 11-KKK |
ComboBox Choices
1-AAA
2-BBB
3-CCC
4-DDD
5-EEE
10-JJJ
11-KKK
I figured out how to get the items from one column but have not been able to figure out how to add the second column data.
Thanks
Solved! Go to Solution.
Hi @AndyVM,
Do you want to get distinct values from both of Text columns and populate the Combo Box with that distinct values?
Could you please share a bit more about your scenario?
I think you could directly collect them into a collection as below:
ClearCollect(
colOPtions,
RenameColumns(
Distinct(
Options,
ColumnA
),
"Result",
"Choices"
)
);
ForAll(
Distinct(
Options,
ColumnB
),
Patch(
colOPtions,
Defaults(colOPtions),
{Choices: Result}
)
)
Options is my data source.
Then you could set the Items of the Combo Box as below:
Distinct(colOPtions,Choices)
Create a collection like this
ClearCollect(MyColl,Choices([@YourList].YourColumn1),Choices([@YourList].YourColumn2))
Set this collection as a data source for your dropdown. You can sanitize the data using Distinct, Sort, etc.
Hi @AndyVM,
Do you want to get distinct values from both of Text columns and populate the Combo Box with that distinct values?
Could you please share a bit more about your scenario?
I think you could directly collect them into a collection as below:
ClearCollect(
colOPtions,
RenameColumns(
Distinct(
Options,
ColumnA
),
"Result",
"Choices"
)
);
ForAll(
Distinct(
Options,
ColumnB
),
Patch(
colOPtions,
Defaults(colOPtions),
{Choices: Result}
)
)
Options is my data source.
Then you could set the Items of the Combo Box as below:
Distinct(colOPtions,Choices)