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

Add Multiple Rows to a Collection Using Cascading Dropdowns & Text Input Boxes

Hi Everyone!

 

So I am creating an app that will automate equipment sizing for our Salesmen.  The app creates a collection based on the input from the Salesmen.  There are three cascading/dependent Dropdowns plus a few Text Input boxes that all work perfectly.  I have a button that will add all this information into a Collection called Survey (each Dropdown and Text Input is a different column in a single row). 

 

So all this is working perfectly but I would like to have a "Next" button that would allow the Salesmen to make new selections from the same Dropdowns/Text Input boxes to add another row to the Collection.  And also a "Done" button to stop adding rows and save the data in the Collection to a new List.

 

How do I go about clearing all the first choices (without deleting the information in the Collection) and adding a new row to the Collection (keeping the first row from the first selections)?

 

I have seen some similar questions where the "Patch" function was used.  But that function does not seem to fit what I am trying to accomplish (or am I misunderstanding its use)?

 

Thank you so much for any advise/suggestions.

  

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Resolver IV
Resolver IV

Re: Add Multiple Rows to a Collection Using Cascading Dropdowns & Text Input Boxes

Hi @suzinger!

 

Based on your requirements, my suggestion is the following:

1. Reset all the controls by using the Reset function when pressing the next button (OnSelect). This will reset the controls to their default value and wont affect the saved values in the collection I.e. Reset(Dropdown1). Then add the record by using Collect and not ClearCollect.

2. When pressing Done, just create a new Collection by fetching all data from Survey. Collect(NewCollection,Survey). You could also, at the same time, clear the Survey collection if you dont the need the values anymore.

 

BR

Pontus

View solution in original post

4 REPLIES 4
Highlighted
Super User III
Super User III

Re: Add Multiple Rows to a Collection Using Cascading Dropdowns & Text Input Boxes

@suzinger 

Could you please give me an example of what the collection should look like before and what the collection should like after?   I have a guess of what you want to do but I am not certain.

 

 

Here's what I think you wanted.  You starting with a collection like this before any changes:

 

ID Field1 Field2 Field3
1 Some Text Some Text Some Text
2 Some Text Some Text Some Text
3 Some Text Some Text Some Text
4 Some Text Some Text Some Text
5 Some Text Some Text Some Text

 

And the collection should look like this after the changes:

 

ID Field1 Field2 Field3
1   Some Text Some Text
2   Some Text Some Text
3   Some Text Some Text
4   Some Text Some Text
5   Some Text Some Text


You can get this result by using the UPDATEIF function and setting the 2nd argument to True so it changes all fields in the column to Blank.  I have provided 2 options below.  Please choose the one that suits you best.

 

UpdateIf(your_collection_name, True, {Field1: ""})
UpdateIf(your_collection_name, True, {Field1: Blank()})

 

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Resolver IV
Resolver IV

Re: Add Multiple Rows to a Collection Using Cascading Dropdowns & Text Input Boxes

Hi @suzinger!

 

Based on your requirements, my suggestion is the following:

1. Reset all the controls by using the Reset function when pressing the next button (OnSelect). This will reset the controls to their default value and wont affect the saved values in the collection I.e. Reset(Dropdown1). Then add the record by using Collect and not ClearCollect.

2. When pressing Done, just create a new Collection by fetching all data from Survey. Collect(NewCollection,Survey). You could also, at the same time, clear the Survey collection if you dont the need the values anymore.

 

BR

Pontus

View solution in original post

Highlighted
Advocate I
Advocate I

RE: Add Multiple Rows to a Collection Using Cascading Dropdowns & Text Input Boxes

Oh my goodness!  Thank you @pontusofsweden!  I was totally making this much more difficult than it needed to be!  I sincerely appreciate your assistance! 🙂

Highlighted
Resolver IV
Resolver IV

Re: RE: Add Multiple Rows to a Collection Using Cascading Dropdowns & Text Input Boxes

My pleasure, @suzinger 🙂

BR

Pontus

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,870)