cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

How to make a collection not Pre-populate

Hi,

 

I currently have a gallery with dropdowns that are text values and the values are set in alphabetical order and a collection that is connected to the gallery. I notice that every time I open this screen, the collection is already per-populated with information from the dropdowns. Is there a formula I can use so that this doesn't occur?

 

Thanks,

Ryan

 

2 REPLIES 2
Highlighted
Frequent Visitor

Re: How to make a collection not Pre-populate

Based on your description, it sounds like your collection is connected directly to the dropdowns, and not based on the Gallery items. Are you wanting the collection to capture the values selected in the dropdowns? Do you have a button to submit or save the answers?

 

If so, you'll want to add a collection to the button, using the OnSelect property, based on the following code:

 

ClearCollect(
<collection name>,
ForAll(
<gallery name>.AllItems,
{
<collectionfieldname>: <gallery item name or id>.Text,
<collectionfieldname>: <dropdown name>.SelectedText.AnswerId
}
)
);

 

When the button is pressed, the selected values from each dropdown will be saved to the collection. 

Highlighted
Community Support
Community Support

Re: How to make a collection not Pre-populate

Hi @Ryan_LaCroix ,

 

Can you please share the formula that you use to create this collection?

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (6,280)