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

Repeating table in PowerApps and Drop Down control

Hi all experts.

 

I have earlier used InfoPath a lot, and wtached a video with Shane Young about using a collection and a gallery in the same way. The video os very good and it works like a charm, I'm only having a problem with two drop down controls in the galery.

 

When I press the save icon to save data to the collection and create a new row, it sort of resets all the rows to a default, and not only the new row. I have tried everything, but cannot figure out how to avoid this behavior. The data is saved in the collection, so that part is okay, but from a user perspective it looks crazy when all the lines in the tables is beeing reset. This is only happening with the drop down controls, the text input fields are working okay.RepeatingTable.PNG

 

The save icon has this code attached:

 

Patch(Rekvisition; ThisItem; {AVarelinie: DropdownVarelinje.Selected.Value; BMængde: TextInputMaengde.Text; CEnhed: DropdownEnhed.Selected.Value});; Collect(Rekvisition; {AVarelinie: ""; BMængde: ""; CEnhed: ""})

 

The two drop down fields has no default value, because the fields are a lookup in a SharePoint list. I have done this many times, and it works great, but just not when I'm creating a new collection Smiley Sad

 

Hope anyone has a solution to help me reach my goal.

 

/Frank Nielsen

Denmark

3 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: Repeating table in PowerApps and Drop Down control

Hi @venseben ,

 

Is this a gallery control in this screenshot? What is the Item property of this gallery? Did you mean that the default property of dropdown controls are blank? What value do you want to set for the default value after submitting?

 

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.
venseben
Level: Powered On

Re: Repeating table in PowerApps and Drop Down control

Hi @v-monli-msft 

Yes, it is a gallery that i have attached in the screenshot. Everytime i pressed the save icon on the right, it did a reset of the value in the dropdown control for all the lines in the gallery, very very strange. However, late last night I came up with an solution. I created a non visible label called "LabelDefault", that has an default text value. I enden up with setting the two drop down fields to set the default data from that label everytime i made a new collection. So now the drop down fields is acting like I want it, maybe not in an elegant coded way, but it works.

 

Collect(Rekvisition; {AVarelinie: LabelDefault.Text; BMængde: ""; CEnhed: LabelDefault.Text})

 

This behaviour has been driving me crazy for weeks, and suddenly this "non-hack" solution came to me.

maru08
Level: Powered On

Re: Repeating table in PowerApps and Drop Down control

Hi venseben,

 

I encountered the same issue on my app as well. I changed the Default property of the drop down control to ThisItem.Value 

Hope this helps.

 

Regards!

10 REPLIES 10
Community Support Team
Community Support Team

Re: Repeating table in PowerApps and Drop Down control

Hi @venseben ,

 

Is this a gallery control in this screenshot? What is the Item property of this gallery? Did you mean that the default property of dropdown controls are blank? What value do you want to set for the default value after submitting?

 

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.
venseben
Level: Powered On

Re: Repeating table in PowerApps and Drop Down control

Hi @v-monli-msft 

Yes, it is a gallery that i have attached in the screenshot. Everytime i pressed the save icon on the right, it did a reset of the value in the dropdown control for all the lines in the gallery, very very strange. However, late last night I came up with an solution. I created a non visible label called "LabelDefault", that has an default text value. I enden up with setting the two drop down fields to set the default data from that label everytime i made a new collection. So now the drop down fields is acting like I want it, maybe not in an elegant coded way, but it works.

 

Collect(Rekvisition; {AVarelinie: LabelDefault.Text; BMængde: ""; CEnhed: LabelDefault.Text})

 

This behaviour has been driving me crazy for weeks, and suddenly this "non-hack" solution came to me.

maru08
Level: Powered On

Re: Repeating table in PowerApps and Drop Down control

Hi venseben,

 

I encountered the same issue on my app as well. I changed the Default property of the drop down control to ThisItem.Value 

Hope this helps.

 

Regards!

sscarcella
Level: Powered On

Re: Repeating table in PowerApps and Drop Down control

would you be able to share an sample of a gallery as repeating table with multiple dropdowns in it.  I cannot get it to work and its been driving me nuts for months...

JR-BejeweledOne
Level: Powered On

Re: Repeating table in PowerApps and Drop Down control

Hi @venseben,

 

I am new to this and working on a repeating table using a gallery as well.   Mine will have dropdowns that are from SharePoint lists.

 

Does your initial collection look like this:

 

collect1.png

 

Or like this

Collect2.png

 

Thanks

 

venseben
Level: Powered On

Re: Repeating table in PowerApps and Drop Down control

Hi @JR-BejeweledOne My collection looks like thisClearCollect.PNG

Hope it can be at any help.

 

/Frank

 

venseben
Level: Powered On

Re: Repeating table in PowerApps and Drop Down control

Hi again @JR-BejeweledOne I forgot that I had some serious trouble finding a way to stop the gallery from inheriting data from previous rows. I could not figure out why it did that, but ende up with a bit of a dirty trick. As you can see in this picture my each dropdown fields has a standard value "Vælg..." (Choose in english).Gallery.PNG

 

To ensure that the two dropdowns had this when I pressed the save icon, I created two labels, and made this when I made the patch function.SaveGallery.PNG

It is two hidden labels, but when I make a new row/collection, these fields are the deault value in a new row. The balue in the labels are "Vælg..."

 

Hope this can help you. I knos it could have been fixed in a much smarter way, but I am not a code guy and deffenitly not a Excel shark, so i had to come up with some kind of solution. And the users are happy, and so I am happy Smiley Happy

/Frank

JR-BejeweledOne
Level: Powered On

Re: Repeating table in PowerApps and Drop Down control

Your post was extremely helpful to me.  Along with yoru post and the reply about using ThisItem.xxx in the default value, I was able to get my app working very nicely.  

 

Mine is a bit unique.   I have fields that I needed to concatenate to create a name that would be populated in the gallery but didn't want the 4 fields that make up the name to be in the gallery.  You can see mine below.

 

HolidayApp.png

JR-BejeweledOne
Level: Powered On

Re: Repeating table in PowerApps and Drop Down control

To stop inheriting data from other rows, you need to use 'ThisItem' in your patch statement and set your default values to ThisItem.xxx.

 

patch.png

 

ThisItem.png

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 229 members 5,037 guests
Please welcome our newest community members: