cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vmakker
Frequent Visitor

LookUp function returns incorrect value when trying to use entry from a multi-select combobox to fetch values from a SharePoint list

Hi, 

So, I have SharePoint list, with two columns

 

 

Name (Title)| Email
Person1     | Email1
Person2     | Email2
Person3     | Email3
Person4     | Email4

 

 

I use the first column as my data source for a multi-select combobox. 

 

Then I populate an input text field with all the values from the combobox concatenated. This works well.

 

 

Left(Concat(combobox.SelectedItems.Title,Concatenate(Title,",")),Len(Concat(combobox.SelectedItems.Title,Concatenate(Title,",")))-1)

 

 

 Let's say the above statement gives me: "Person2,Person3,Person4" in the text field, which is what I selected in the combobox.

 

Using the same logic, I thought I could populate another text field with the emails of people selected by using LookUp.

 

 

Concat(combobox.SelectedItems.Title,Concatenate(LookUp(SharePointList,'Name'=Text(Title),Email),";"))

 

 

 However, when I select Person2, Person3, and Person4 from the combobox, it always returns "Email1;Email1;Email1", instead of "Email2;Email3;Email4", for some reason the LookUp formula is only returning the first value.

 

How can I solve this?

 

 

Thank you

1 ACCEPTED SOLUTION

Accepted Solutions
WarrenBelz
Super User
Super User

Hi @vmakker ,

Please try this

Concat(
   ForAll(
      combobox.SelectedItems As aSel,
      LookUp(
         SharePointList,
         'Name' = aSel.Title
      ).Email
   ),
   Value,
   ","
)

also your first one can be condensed to this

Concat(
   combobox.SelectedItems, 
   Title,
   ","
)

 

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

View solution in original post

2 REPLIES 2
WarrenBelz
Super User
Super User

Hi @vmakker ,

Please try this

Concat(
   ForAll(
      combobox.SelectedItems As aSel,
      LookUp(
         SharePointList,
         'Name' = aSel.Title
      ).Email
   ),
   Value,
   ","
)

also your first one can be condensed to this

Concat(
   combobox.SelectedItems, 
   Title,
   ","
)

 

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

Thank you so very much! Accepted as solution.

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,705)