cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
iamsujith
Level: Powered On

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 Customisation Screen.JPGPlan 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'

Customize Screen.JPGPlan 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 selection.JPGMultiproduct 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. 

1 REPLY 1
Community Support Team
Community Support Team

Re: Auto create unique collection names in PowerApps?

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)

Button_Add.OnSelect:UpdateContext({value:value+1}) 

Label_Name.Text:"CollectPlan"&value&","&"CollectHandset"&value&","&"CollectAddOns"&value&","&"CollectDiscounts"&value

20190327autocollectionname.PNG

 

test:

20190327autocollectionnamegif.gif

 

Hope this could be helpful.

 

Best Regards.

Yumia

 

Helpful resources

Announcements
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (8,781)