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 / Using a combobox to se...
Power Apps
Answered

Using a combobox to select several values from a lookup field, pointing to another list

(0) ShareShare
ReportReport
Posted on by 20

I have a lookup field Team in a Projects-SPO List. The field Team is linked to an another SPO-List Colleagues.

The lookup field Team can contain several Colleagues.

I use a combobox in a gallery pointing to a record in Projects to select Colleagues (items:Colleagues and DefaultItemsSelected:thisitem.Team)

When I update, only new selected Colleagues are written to the Projects-list. Existings Colleagues are gone!

Patch(Projects;LookUp(Projects;Code="TEST");

  {Team: ForAll(ComboBox.SelectedItems;    {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference";

   Id:ID;Value:ID})})

 

The instruction below gives an error (Table expected, but other schema)

Patch(Projects;LookUp(Projects;Code="TEST");

   {Team:ComboBox.SelectedItems})

 

With dropdown (single values) linked to an other list, it works fine

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @SP_Ontwikkelaar 

    Inside your ForAll, why are you using Value:ID? Does Value:Value work?

  • SP_Ontwikkelaar Profile Picture
    20 on at

    Value:ID or Value;"abc" doesn't matter, Value:Value doesn't work

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @SP_Ontwikkelaar 

    To test your code, I setup a ComboBox (multi select) linked to another SP list. 

     

    Items = Choices(myList.myColumnName) --> note this is different to your setup

     

    Patch code

    Patch (
     myList,
     LookUp(myList, ID = 1), // I used ID = 1 for testing purposes
     { myColumnName: ForAll(
     ComboBox1.SelectedItems,{ 
     '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
     Id: Id, 
     Value: Value })
     }
     )

    This code works because of the way I have setup my Items property of the ComboBox.

     

    To write the code with your setup, you need to use a LookUp() for your Value and Id, eg

    Id: LookUp( Choices(Projects.Team), Value = Colleague, Id)

    Value: LookUp( Choices(Projects.Team), Value = Colleague, Colleague)

     

    I couldn't get the above LookUps to work properly (due to work constraints) but this is the concept you need to get it working. The easiest way is to use the code above that and adjusting your ComboBox Items property to something like

     

    Items = Choices(Projects.Team)

     

  • SP_Ontwikkelaar Profile Picture
    20 on at

    This is a great solution! Choices of the lookup field instead of the external list. Thanks a lot!

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
WarrenBelz Profile Picture

WarrenBelz 421 Most Valuable Professional

#2
11manish Profile Picture

11manish 153 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 116 Super User 2026 Season 2

Last 30 days Overall leaderboard