web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Repeating table in Pow...
Power Apps
Answered

Repeating table in PowerApps and Drop Down control

(0) ShareShare
ReportReport
Posted on by

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

Categories:
I have the same question (0)
  • Verified answer
    v-monli-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    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

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    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.

  • Verified answer
    Community Power Platform Member Profile Picture
    on at

    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 Profile Picture
    239 on at

    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 Profile Picture
    5,836 Moderator on at

    Hi @Anonymous,

     

    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

     

  • Community Power Platform Member Profile Picture
    on at

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

    Hope it can be at any help.

     

    /Frank

     

  • Community Power Platform Member Profile Picture
    on at

    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

  • JR-BejeweledOne Profile Picture
    5,836 Moderator on at

    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 Profile Picture
    5,836 Moderator on at

    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

  • Community Power Platform Member Profile Picture
    on at

    Hi @JR-BejeweledOne So nice taht I could be at any assistance. And 1000 times THX for the tip about stop inheriting data from other rows 🙂

     

    Have a fantastic day and weekend

    /Frank

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard