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 / Patch function for com...
Power Apps
Answered

Patch function for combo box if multiselected items exist

(1) ShareShare
ReportReport
Posted on by 225 Moderator

I have 2 combo boxes 

Group1 and group2

I am getting the values from SharePoint list by using distinct function

those 2 groups datatype in SharePoint list is text fields.

 

My problem is if we select multiple values in combo boxes then only one value is adding to the another SharePoint list.

I am using patch function to add the values which consists of 10 fields.

please suggest me how to do it.

 

Thanks in advance

Usha.

Categories:
I have the same question (0)
  • Verified answer
    anandm08 Profile Picture
    1,936 Super User 2024 Season 2 on at

    hi @UshaJyothi20 ,

    try this:

    // Assuming you have two combo boxes named Group1 and Group2
    // and a SharePoint list named 'YourSharePointList' with text fields 'Group1Values' and 'Group2Values'.
    
    // Convert the selections from Group1 to a comma-separated string
    Set(
     Group1ValuesString,
     Concat(Group1.SelectedItems, Value & ", ")
    );
    
    // Convert the selections from Group2 to a comma-separated string
    Set(
     Group2ValuesString,
     Concat(Group2.SelectedItems, Value & ", ")
    );
    
    // Patch function to add the values to the SharePoint list
    Patch(
     YourSharePointList,
     Defaults(YourSharePointList),
     {
     Group1Values: Left(Group1ValuesString, Len(Group1ValuesString) - 2), // Remove the trailing comma and space
     Group2Values: Left(Group2ValuesString, Len(Group2ValuesString) - 2), // Remove the trailing comma and space
     // Add other fields here as needed
     }
    );

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 408

#2
timl Profile Picture

timl 340 Super User 2026 Season 1

#3
Vish WR Profile Picture

Vish WR 319

Last 30 days Overall leaderboard