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 / combobox patch several...
Power Apps
Answered

combobox patch several selected entries each as a new entry

(0) ShareShare
ReportReport
Posted on by 147

Hello,

 

quick question, how do I patch multiple "selected" entries from a combobox?

My combo box is called: ComboBox1

 

But if only one entry is selected, then only patch that one, if several then patch all of them.

The patching process should take place as “default”.

 

It should be patched in a Sharepoint list. As I said, each entry individually..

 

My patch function:

Patch(News;

Defaults(News);

   

{

    sent_by: User().FullName;

    Regarding:TextInput_Betreff_News_2.Text;

    to_employee: Concat(ComboBox1.SelectedItems;displayName & ";");

    Description:RichTextEditor1.HtmlText;

    'News_visible-von':dt_zeit_von_News.Value;

    'News_visible-bis':dt_zeit_bis_News.Value

    

}

);;

 

 

I tried the following:

ForAll(

    ComboBox1.SelectedItems,

    Patch(

        News;

        LookUp(

            News;

            ID = ThisItem.ID  // I don't know what to add, it's the first entry

        );

        {

          

sent_by: User().FullName;

    Regarding:TextInput_Betreff_News_2.Text;

    to_employee: Concat(ComboBox1.SelectedItems;displayName & ";");

    Description:RichTextEditor1.HtmlText;

    'News_visible-von':dt_zeit_von_News.Value;

    'News_visible-bis':dt_zeit_bis_News.Value

 

        }

    )

)

Categories:
  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    Hi @memphis11 ,

    Assuming you want a separate record for each selected item - you cannot patch to current record if you want separate records - the code below will create new records

    Patch(
     News;
     ForAll(
     ComboBox1.SelectedItems As _Data;
     {
     Sent_by: User().FullName;
     Regarding: TextInput_Betreff_News_2.Text;
     to_employee: _Data.displayName;
     Description: RichTextEditor1.HtmlText;
     'News_visible-von': dt_zeit_von_News.Value;
     'News_visible-bis': dt_zeit_bis_News.Value
     }
     )
    )

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • memphis11 Profile Picture
    147 on at
    Hello,
     
    Perfect, that was the solution. Thank you....
     
    one more question:
     
    I created a collection: 
    ClearCollect(vl_All_Holding;Filter(vl_All_Groups; StartsWith(displayName; "vl")));;
     
    I have a combination field: (ComboBox1_8)
    Sort(vl_All_Holding; displayName;SortOrder.Ascending)
     
    OnSelect: ClearCollect(MitgliederGruppe; 'Office365-Gruppen'.ListGroupMembers(ComboBox1_8.Selected.id).value)
     
     
    One Gallery:
    Items: MitgliederGruppe
    Title: ThisItem.mail
     
    All email addresses of all members of this group are listed, so far so good
     
     
    Now I would like to use my patch variant:
    Patch(
       News;
       ForAll(
          ComboBox1.SelectedItems As _Data;
          {
             Sent_by: User().FullName;
             Regarding: TextInput_Betreff_News_2.Text;
             to_employee: _Data.displayName;
             Description: RichTextEditor1.HtmlText;
             'News_visible-von': dt_zeit_von_News.Value;
             'News_visible-bis': dt_zeit_bis_News.Value
          }
       )
    )
     
    if an entry is included then patch it, if not then don't
  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    @memphis11 ,

    I am not entirely clear here, but the value you need seems to be 

    ComboBox1_8.Selected.displayName

    and the Patch would depend on the type of field you are writing to. I am assuming you want the same value written to each of the created records. Is this what you are wanting to do ?

  • memphis11 Profile Picture
    147 on at

    Yes, exactly, the field for the patch is: to_employee:


    he aim should be to patch either from a combo box (see patch from you above = it works) or from the gallery with all entries (email).

    Or just from one of these fields

  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    @memphis11 ,

    Where are you getting the value from if the is nothing selected in the Combo Box and what do you want to do with it ? I am unclear on your process.

  • memphis11 Profile Picture
    147 on at

    If there is nothing in the combo box then the gallery remains empty
    But if something is selected from the combo box, all members with the email address appear in the gallery

    Now I want to patch all entries (whether from the gallery or from the dropdown field) into the SharePoint list
    If something is empty then skip it.

     

    memphis11_0-1709516599439.png

     

  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    @memphis11 ,

    Sorry I am lost here - what gallery? I am mobile presently, so please take your time responding with a description of exactly what you are trying to do - bear in mind I cannot see your app or data 

  • memphis11 Profile Picture
    147 on at

    Sorry, my English isn't that good

    ComboBox field: (Sort(vl_All_Holding; displayName;SortOrder.Ascending)
    vl_All_Holding; => all O365 Distributiongroup

    OnSelect:
    ClearCollect(MembersGroup; 'Office365 Groups'.ListGroupMembers(ComboBox1_8.Selected.id).value) 
    (second from top left)

    Gallery:
    Gallery: Items: MembersGroup (right side in the picture)


    Patch function: (button at the bottom right)
    Patch(News;
     ForAll(
        ComboBox1.SelectedItems As _Data;
    {

        gesendet_von: User().FullName;
        Betreff:TextInput_Betreff_News_2.Text;
        an_Mitarbeiter: _Data.displayName;
        Beschreibung:RichTextEditor1.HtmlText;
        'News_sichtbar-von':dt_zeit_von_News.Value;
        'News_sichtbar-bis':dt_zeit_bis_News.Value
    }
    ));;

  • Verified answer
    WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    @memphis11 ,

    You would replace ComboBox1.SelectedItems with MembersGroup. Please have an attempt at this and I will correct if necessary when I am back on my PC.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard