Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Auto create unique collection names in PowerApps?

I am hoping to find if I can iterate the process of auto-creating unique collection names (for instance -Collect1,Collect2,Collect3...) based on the number of times a button is clicked in PowerApps. To elaborate in detail, I will explain the working of the app through screenshots from my current app (shown below) to demonstrate what happens in every screen and ultimately showing where I am struggling with.

Working of the app:

Plan Customisation  - Under the 'Plans' Tab, a Mobile Plan is selected from a Gallery and a'Handset' is selected from the 'dropdown box'. The selected items are added to two different collections namely
1. 'CollectMobilePlan1'
2. 'CollectHandset1'


Plan Customization ScreenPlan Customization Screen

Following a similar process, other selected items ( Accessory Repayment Option $360, Valued Customer Bonus) are added to two different collections namely

3. 'CollectAddOns1'

4. 'CollectDiscounts1' 

All of the selected four collections along with the total cost of the selected items are displayed in a Gallery as shown below in the 'Plan Summary Screen'

Plan Summary ScreenPlan Summary Screen

What I am hoping to achieve is to add a button called 'Add More Products' and when the user clicks this button, the whole process mentioned above (Plan Customisation - CollectPlan, CollectHandset, CollectAddOns, CollectDiscounts) should begin again. What I am struggling is with how to go about coding PowerApps to collect a different set of collections (i.e. CollectPlan2, CollectHandset2, CollectAddOns2, CollectDiscounts2) when the user hits the 'Add More Products' button.  The third time when the user hits the 'Add More Products' button, a third set of collections should be created(CollectPlan3,CollectHandset3,CollectAddOns3, CollectDiscounts3) and the whole processs should repeat and so on. The end result should be along the lines of how it appears below.
(I have just copied the same information twice for illustrative purposes)

Multiproduct selectionsMultiproduct selections

I am a beginner in PowerApps so any directions to achieve the same would be of immense help as I have been struggling to find a solution for the same. 

Community Support
Community Support

Hi @iamsujith ,


Do you want to auto create collection names?

You can use updatecontext function to achieve this.You can try the following workaround,I test as next:


Add two button controls and one label control, and rename them as the next screenshot shows.

Button_Reset.OnSelect:UpdateContext({value:0}) (I set 0 on my side,you can change the value on your side)








Hope this could be helpful.


Best Regards.



Helpful resources

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Top Solution Authors
Top Kudoed Authors
Users online (2,035)