I'm trying to add items selected from three dropdown lists to a gallery list after I hit an add button. The image attached below is what I'm shooting for it to look like. I've been trying to figure this out for ages and I can't find anything to assist me.
Essentially I have three drop-down menus. Business Type, Line of Business, and RBC Type. I want to be able to select the entries I want from the drop downs and then add those values to a list when I hit an add button. There is also a clear button underneath the add button to clear the list.
The other requirement for this is that there needs to be at least 1 item in the list but no more than 5 items total. I'm at my wit's end trying to figure this out I'm really hoping someone could offer a solution for me.
Solved! Go to Solution.
Hi!
Ok, so it´s one record per Add click. So, I guess the easiest way is to create a Collection when pressing the Add button and the use the Collection as datasource to the gallery.
Collect(DropDownListCol,{BusinessType:Dropdown1.SelectedText.Value,LineOfBusiness:Dropdown1_1.SelectedText.Value,RBCType:Dropdown1_2.SelectedText.Value})
Clear(DropDownListCol)
Hope this helps 🙂
BR
Pontus
Hi!
Question; when you hit the Add button, do you want to create one record with three columns or three records with one column? Also, which datasource are you using for the gallery? External or is it just a collection?
BR
Pontus
So with the dropdowns, I just want to take the entires (from the photo as an example 'Aviation', 'Ordinary Life', and 'IMM') and add them all on one line in a gallery. So I guess one column one row per add button. If it would be easier to do 3 columns one row per add button then I could do that too. I'm not exactly sure what you mean by the data source as I am new to power apps but for right now I don't have either set up I believe.
Hi!
Ok, so it´s one record per Add click. So, I guess the easiest way is to create a Collection when pressing the Add button and the use the Collection as datasource to the gallery.
Collect(DropDownListCol,{BusinessType:Dropdown1.SelectedText.Value,LineOfBusiness:Dropdown1_1.SelectedText.Value,RBCType:Dropdown1_2.SelectedText.Value})
Clear(DropDownListCol)
Hope this helps 🙂
BR
Pontus
@pontusofsweden
I believe that will help, just one question: what do you mean by adding labels to the gallery? Like a text label from the insert tab? or something under properties? Edit: also how would I limit that list to just 5 items and require it to have at least one item before the form is submitted?
Hi,
yes, a text label from the Insert Tab
BR
Pontus
@pontusofsweden Okay thank you, you've been a world of help! I just need to figure out how to limit the number of entries to 5 and require at least 1.
To limit the entries, you can just adjust the OnSelect property of the Add button to only add records if the total amount of rows in your collection is less than 5:
If(CountRows(DropDownListCol) < 5;Collect(DropDownListCol{BusinessType:Dropdown1.SelectedText.Value;LineOfBusiness:Dropdown1_1.SelectedText.Value;RBCType:Dropdown1_2.SelectedText.Value}))
Not sure what you mean with at least 1. To be able to do what? Anyway, you can use a similar If statement as above but check that the ampunt of rows is larger than 0. Like:
If(CountRows(DropDownListCol) > 0)
BR
Pontus
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
209 | |
194 | |
82 | |
58 | |
38 |
User | Count |
---|---|
303 | |
249 | |
120 | |
83 | |
55 |