cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper IV
Helper IV

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
Community Support

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.

View solution in original post

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.

View solution in original post

Advocate II
Advocate II

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!

View solution in original post

20 REPLIES 20
Community Support
Community Support

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.

View solution in original post

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.

View solution in original post

Advocate II
Advocate II

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!

View solution in original post

Kudo Collector
Kudo Collector

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...

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

 



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

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

Hope it can be at any help.

 

/Frank

 

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 🙂

/Frank

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



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

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



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (58,545)