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 and Co...
Power Apps
Unanswered

Repeating Table and ComboBox

(0) ShareShare
ReportReport
Posted on by 762

Hello Community,
I need your help please!
I have created a repeating section using a gallery, which is currently doing what I expect, apart from when I click the save icon.

I select my first item - Menu Item from the choices, then when I hit the save icon, the option disappears or repeats the first selection. 

 

ClaireAllen_0-1640102751444.png

Any ideas on how to stop this from happening.

Thank you in advance

Claire

Categories:
I have the same question (0)
  • Devikumari Krishna Profile Picture
    988 Super User 2024 Season 1 on at

    Hi @ClaireAllen ,

     

    Can you post here what is the value you have on submit icon ->'Onselect'

     

    -------------------------------------------------------------------------
    If I have answered your question, please mark your post as Solved.
    If you like my response, please give it a Thumbs Up.

     

    Regards

    Devi

  • v-xiaochen-msft Profile Picture
    on at

    Hi @ClaireAllen ,

     

    If you don't want the selected value to be changed, you could set a variable to DefaultSelectedItems property.

    For example:

    submit buttion onselect property :

    Set(Var,combo box control.Selected);Reset(combo box control)

     

    combo box control DefaultSelectedItems property:

    Var

     

    Best Regards,

    Wearsky

  • ClaireAllen Profile Picture
    762 on at

    Hi @DeviKrishna ,

    I have a Patch function on the Onselect of the Save Icon

    ClaireAllen_0-1640165130628.png

    And on the Save & Submit button onSelect I have Submit Form

     

    Thank you

    Claire

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    Hi @ClaireAllen ,

    So I am clear here, you have a gallery with a Save icon in it - that when pressed Patches to a Collection and then writes a new record to that collection

    Patch(
     HospitalityCollection, 
     ThisItem, 
     {
     Menultem: Menultem, 
     Time: TimeRequired.Text, 
     Location: Room.Text, 
     Persons: Persons.Text
     }
    ); 
    Collect(
     HospitalityCollection, 
     {
     Menultem: "",
     Time: "",	 
     Location:	"",
     Persons: ""
     }
    )

    You then mention a Save and Submit button which is on a Form. What exactly is this Form doing and what is the gallery doing that you do not expect it to do?

     

  • ClaireAllen Profile Picture
    762 on at

    @WarrenBelz ,

    The issue I am facing is that in the Gallery I have a combo box, when I select the Save icon, it adds a new line as to work as a repeating section, the previous selection I made in the combo box is removed and leaves a blank value.

    This is the issue I am trying to resolve, how to stop my previous selection from disappearing.

    Thank you & regards

    Claire 

  • WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    @ClaireAllen ,

    What is the DefaultSelectedItems of the Combo Box - if this does not refer to a field in the Collection, then it will reset when the code is run from inside the gallery (and do exactly what you are experiencing). Also what is the Items of the Combo Box?

  • ClaireAllen Profile Picture
    762 on at

    @WarrenBelz 
    The Items is showing the following - Choices(hospitalityrequest.MenuItem)
    I don't currently have anything in the DefaultSelectedItems , I've tried a filter and a {Value:} but I can't seem to get anything to work

    Thank you for taking the time to look at this for me.
    Regards

    Claire

  • Verified answer
    WarrenBelz Profile Picture
    153,026 Most Valuable Professional on at

    HI @ClaireAllen ,

    As I mentioned you need to bind the control to a value or it will reset to blank - in your DefaultSelectedItems

    {Value:ThisItem.MenuItem}

     Your Patch

    Patch(
     HospitalityCollection, 
     ThisItem, 
     {
     Menultem: ComboBoxName.Selected.Value, 
     Time: TimeRequired.Text, 
     Location: Room.Text, 
     Persons: Persons.Text
     }
    ); 
    Collect(
     HospitalityCollection, 
     {
     Menultem: "",
     Time: "",	 
     Location:	"",
     Persons: ""
     }
    )

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    Visit my blog Practical Power Apps

  • ClaireAllen Profile Picture
    762 on at

    @WarrenBelz ,
    Thank you very much for your help, all working 😀
    Kind regards

    Claire

  • lras120265 Profile Picture
    on at

    Hello,

    I am having the same issue, with multi select for the combo box, using the formula below but only keeps the first selected value. Could anyone help?

    {Value:ThisItem.MenuItem}

     

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard