
Announcements
I have a Gallery inside a Card of a Form. This Gallery has two elements: a ComboBox (of peoples' names pulled from a SharePoint List) and a Dropdown (with custom values).
From my understanding, to collect each "row" of the Gallery's elements into a collection, the code should be something like this:
ForAll(Gallery1.AllItems, Collect(tempCol, {Name: ComboBox1.Selected.Name, Type: Dropdown1.Selected.Value}))
From another post, I read that the button triggering the collection needs to be inside the same card as the gallery otherwise it won't collect anything. So I've created a button inside the same card and set the above to it.
When I click the button, the collection's values are blank. The collection has a row for each "row" of the Gallery, but it appears that it couldn't read the values of the combobox or dropdown.
I discovered that if I set a Default value for the combobox or dropdown, then the button will collect that default value instead of nothing.
What might be going on here? Why can't Collect read the values of the combobox and dropdown?
Thanks
The following will concat everything selected in combobox 1 (Person 1, Person 2, Person 3, Person 4) in a Name Column of tempCol, and in second Type column return the value selected from your dropdown
ClearCollect(
tempCol,
ForAll(
Gallery11.AllItems,
If(IsBlank(ComboBox5.SelectedItems)=false,
{ Name: Concat(ComboBox5.SelectedItems,Title,", "),
Type: Dropdown6.Selected.Value
})
)
)
Concat portion can also be changed to collect a nested table of names, instead of having them as a string.