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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patching Combo box fie...
Power Apps
Answered

Patching Combo box fields (multi-values)

(1) ShareShare
ReportReport
Posted on by 21
Hi,

I have the following single line of text fields in a Sharepoint List:
  • Fiscal year
  • Period
  • Business Unit
  • Cost Center
  • G/L Account
Then in my Power Apps form, these fields are all in combo box control. The choices for each are coming from different secondary sharepoint lists. Then I allowed multiple-select for Cost Center and G/L Account.

Whenever I submit a new item, the values selected in these 5 fields are not stored/reflected in the Sharepoint list.

Here's the configuration of my form.

In my Submit button's OnSelect is:
 
NewForm(NewForm);
SubmitForm(NewForm);


Then in my NewForm's OnSuccess property:

Set(
    varRecord,
    Self.LastSubmit
);
 
If(
    IsError(
        Patch(
            'DataSource',
            varRecord,
            {
                'Fiscal Year': combo_FY.Selected.'Fiscal Year',
                'Period': combo_Period.Selected.Title,
                'Business Unit': combo_BU.Selected.Title,
                'Cost Center': Left(Concat(combo_CC.SelectedItems, Title & ", "), Len(Concat(combo_CC.SelectedItems, Title & ", ")) - 2),
                'G/L Account': Left(Concat(cb_GL.SelectedItems, 'GL code' & ", "), Len(Concat(cb_GL.SelectedItems, 'GL code' & ", ")) - 2),
                Flag: 1
            }
        )
    );
    Notify("Patch failed", NotificationType.Error),
    Notify("Patch succeeded", NotificationType.Success)
);
 
Navigate(HomeScreen, ScreenTransition.None);

I have tested this, it says 'Patch succeeded' but still, values are not reflected in Sharepoint. I tested selecting multiple values of Cost Center and G/L Account. I even tried changing it to internal names like:



What am I missing?

Again, in my main list, these fields are single line of text but in the form, I made them as combo box controls with choices coming from different sharepoint list.
Categories:
I have the same question (0)
  • Suggested answer
    stampcoin Profile Picture
    5,146 Super User 2026 Season 1 on at
     
    Instead of relying on SubmitForm and then patching, directly use Patch in your button's OnSelect to ensure correct data submission in one step.
    Replace your button's OnSelect property with the following (adjusting field/internal names accordingly)
     
    // Prepare concatenated strings for multi-select combo boxes
    Set(
        varCostCenters,
        Concat(combo_CC.SelectedItems, Title, ", ")
    );
    
    Set(
        varGLAccounts,
        Concat(cb_GL.SelectedItems, 'GL code', ", ")
    );
    
    // Patch a new record directly
    Set(
        varRecord,
        Patch(
            'DataSource',
            Defaults('DataSource'),
            {
                'Fiscal Year': combo_FY.Selected.'Fiscal Year',
                'Period': combo_Period.Selected.Title,
                'Business Unit': combo_BU.Selected.Title,
                'Cost Center': varCostCenters,
                'G/L Account': varGLAccounts,
                Flag: 1
            }
        )
    );
    
    // Check if patch succeeded
    If(
        !IsBlank(varRecord),
        Notify("Patch succeeded", NotificationType.Success);
        Navigate(HomeScreen, ScreenTransition.None),
        Notify("Patch failed", NotificationType.Error)
    );
    
     
  • Suggested answer
    MS.Ragavendar Profile Picture
    6,337 Super User 2026 Season 1 on at
     
    For Single Line of Text just give comboboxcontrolname.Selected
     
    More Info
     
     
    Instead of this,
    Set(
        varRecord,
        Self.LastSubmit
    );
     
    Try with Defaults(DataSource) for newly creation of record for existing record use Lookup(datasource, ID=ItemId) accordingly.
     
     
    🏷️ Please tag me @MS.Ragavendar if you still have any queries related to the solution or issue persists.
    Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
  • WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at
    Adding to what @stampcoin has posted, if you are actually needing to patch that data OnSuccess of the Form, there are a number of fundamental issues with what you are doing: -
    • You have NewForm(NewForm) before SubmitForm(NewForm), which means the form will be cleared before you submit it.
    • NewForm is not a good name for a Form as it is a Reserved Word in Power Apps and I suggest you change it.
    • Once the Form is submitted, the values are cleared, meaning you cannot then reference the control values OnSuccess
    • You do not need all the string manipulation on the Concat - @stampcoin has also addressed this - if you use what is posted.
    With all that in mind, you can set a Table Variable before you submit the Form like this
    UpdateContext(
       {
          varRecord:
          {
             'Fiscal Year': combo_FY.Selected.'Fiscal Year',
             'Period': combo_Period.Selected.Title,
             'Business Unit': combo_BU.Selected.Title,
             'Cost Center': Concat(combo_CC.SelectedItems, Title, ", "),
             'G/L Account': Concat(cb_GL.SelectedItems, 'GL code', ", "),
             Flag: 1
          }
       }
    );
    SubmitForm(NewForm);
    NewForm(NewForm)
    and the OnSuccess
    If(
       IsError(
          Patch(
             'DataSource',
             Self.LastSubmit,
             {
                'Fiscal Year': varRecord.'Fiscal Year',
                'Period': varRecord.Period',
                'Business Unit': varRecord.'Business Unit',
                'Cost Center': varRecord.'Cost Center',
                'G/L Account': varRecord.'G/L Account'
                Flag: 1
             }
          )
       );
       Notify("Patch failed", NotificationType.Error),
       Notify("Patch succeeded", NotificationType.Success)
    );
     
    Please click Does this answer your question 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 a Like.
    Visit my blog Practical Power Apps    LinkedIn   
  • Suggested answer
    LaraDanicaLim Profile Picture
    21 on at
    Hi, @WarrenBelz @MS.Ragavendar @stampcoin.

    Thanks for all your responses. I tried everything. However, I tried searching more and figured that patching is not needed. Since the combo boxes are already inside a data card, the data card's Update property must be configured like: 
     
    combo_FY.Selected.'Fiscal Year'
    combo_BU.Selected.Title

    and etc.

    Then  
    SubmitForm(New_Form); is already enough without patching.

    Anyway, thank you so much! This is my first time with Power Apps so I'm still having challenges with the basics.
  • Verified answer
    WarrenBelz Profile Picture
    154,799 Most Valuable Professional on at
    We all assumed that you had a reason for patching OnSuccess after submitting the Form - this is normally done when additional values not on the Form are added.
    If both of those are multi-select Combo Boxes and the field is a Single Line of Text, then the Update would be
    Concat(
       combo_FY.SelectedItems,
       'Fiscal Year',
       ", "
    )
    and
    Concat(
       combo_BU.SelectedItems,
       Title,
       ", "
    )
     
    Please click Does this answer your question 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 a Like.
    Visit my blog Practical Power Apps    LinkedIn   

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 538

#2
WarrenBelz Profile Picture

WarrenBelz 420 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard