Hello Community,
I'm a beginner with Power Apps and this seems a pretty complex case for me. I need your valuable help with some inputs before I venture into the rabbit hole of For All and Split with Collect.
Basically, I have some ComboBoxes with multiple selected items when that case may apply. This implies that we can have some sort of combinations between the columns values. And I want to have all the combinations in a collection that will ultimately be Patched to a SharePoint, I guess.
Example of selections:
AccessSelect (single selection) | AccessType | Tool | |
Select A | Type A; Type B | Tool 1; Tool 2 | Mail 1; Mail 2 |
Example of how the collection should look like:
AccessSelect | AccessType | Tool | |
Select A | Type A | Tool 1 | Mail 1 |
Select A | Type A | Tool 2 | Mail 1 |
Select A | Type B | Tool 1 | Mail 1 |
Select A | Type B | Tool 2 | Mail 1 |
Select A | Type A | Tool 1 | Mail 2 |
Select A | Type A | Tool 2 | Mail 2 |
Select A | Type B | Tool 1 | Mail 2 |
Select A | Type B | Tool 2 | Mail 2 |
Many Thanks!
Solved! Go to Solution.
Hi @IveGotThePowa ,
Do you want to get all combinations of multiple Combo Box selected items?
I have made a test for your reference.
Try to use the following formula:
Clear(var_combine);
ForAll(
ComboBox1.SelectedItems As c1,
ForAll(
ComboBox2.SelectedItems As c2,
ForAll(
ComboBox3.SelectedItems As c3,
ForAll(
ComboBox4.SelectedItems As c4,
Collect(
var_combine,
{
AccessSelect: c1.Value,
AccessType: c2.Value,
Tool: c3.Value,
Mail: c4.Value
}
)
)
)
)
)
Result Screenshots:
Best Regards,
Charlie Choi
Hi,
Maybe could you try something like that.
Try to use a collection that you will Collect whenever the structure of the different elements is not in it.
Example :
You had only check "Select A" : { AccessSelect : "Select A", AccessType: "", Tool : "", Mail : ""}
Next you select "Type A", so you check if an element in your collection had already "Select A" in and no AccessType. If yes you update your element with "Type A" to get : { AccessSelect : "Select A", AccessType: "TypeA", Tool : "", Mail : ""}, if no, you Collect a new element.
I'm not sure if that is understandable but I hope that will help you.
Hi @IveGotThePowa ,
Do you want to get all combinations of multiple Combo Box selected items?
I have made a test for your reference.
Try to use the following formula:
Clear(var_combine);
ForAll(
ComboBox1.SelectedItems As c1,
ForAll(
ComboBox2.SelectedItems As c2,
ForAll(
ComboBox3.SelectedItems As c3,
ForAll(
ComboBox4.SelectedItems As c4,
Collect(
var_combine,
{
AccessSelect: c1.Value,
AccessType: c2.Value,
Tool: c3.Value,
Mail: c4.Value
}
)
)
)
)
)
Result Screenshots:
Best Regards,
Charlie Choi
Hi Charlie,
Yes, you were correct. I do want to get all the combinations, and as far as can I see your suggestion works.
Thank you!
User | Count |
---|---|
260 | |
123 | |
99 | |
48 | |
43 |