
As you can see in the above GIF, I'd like to add new values to a temporary collection (located on the far right). It works the first time around but if you attempt to add another custom value it blanks out all the previous values and adds the newest one.
This is basically a workaround to allow custom user input which will automatically select the custom value as well everything else that was selected too, while also clearing the search text. From what I've read in multiple places on this forum and online, there is no easy or built-in way of doing this. Otherwise the user would enter the value, select the Yes button, which adds it to the permanent collection (located left of the temporary one). Then the user would have to select the combo box, select the value they just added, and clear out the search text. This is very clunky and not something I want.
How do I get the temporary collection to keep the previous entries and simply add the new one? I've tried ClearCollect assuming it would basically just be constantly "refreshing" itself, but that doesn't seem to be the case. I've also tried to just place a Clear(TempServersCollection) before a regular Collect thinking it would empty the collection and grab everything again, but it doesn't. Here is my code:
ComboBox2
Items = Servers
DefaultedSelectedItems = TempServersCollection
'Yes Button' - OnSelect
Collect(
Servers,
{'Server Name': ComboBox2.SearchText}
);
Clear(TempServersCollection);
Collect(
TempServersCollection,
ForAll(
ComboBox2.SelectedItems,
{Value: Text('Server Name')}
),
{Value: ComboBox2.SearchText}
);
Reset(ComboBox2);
Gallery1
Items = Servers
Gallery2
Items = TempServersCollection