cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AsanKani
Skilled Sharer
Skilled Sharer

ComboBox Multi Select DefaultSelecteditems duplicated

Hi, 

I have using ComboBox with SelectMultiple -> true. Data Load form SharePoint Lookup column with Multiple value. 

ComboBox Items ->Gallery to fetch SharePointList (Lookup multiple value field)

In my PowerApps page, I need to load existing item. It's working. but it's shown addition items.

DataLoading + List items available in my ComboBox.. How to avoid existing data loaded items in ComboBox...

See below for more information...


ComboBox Coding : 

DefaultSelectedItems : 

 

Gallery1.Selected.Authority_Designation

 

Items: SharePointList

SelectMultiple - true

 

While i am selecting Gallery, ComboBox default view Selected items Authority Designation. But if i need to update this... 

ComboBox having items Default view + List items... how to filter & set in combobox this Default view + (List items - default view)?

 

image.pngimage.png

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@AsanKani 

Consider changing your Items property of the Combobox to the following:

    RenameColumns(ShowColumns(SharePointList, "ID", "Title"), "ID", "Id", "Title", "Value")

 

If your Lookup column in SharePoint is defined to get its value from some other column beside Title, then change the above accordingly.  You will need to look at your Lookup column definition in your SharePoint list settings to know for sure.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@AsanKani 

Consider changing your Items property of the Combobox to the following:

    RenameColumns(ShowColumns(SharePointList, "ID", "Title"), "ID", "Id", "Title", "Value")

 

If your Lookup column in SharePoint is defined to get its value from some other column beside Title, then change the above accordingly.  You will need to look at your Lookup column definition in your SharePoint list settings to know for sure.

 

I hope this is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

@RandyHayes 

Wow... it's really great.. working good.

Thanks lot @RandyHayes .. I have post another one. if possible you can help.. again thanks... 🤝

RandyHayes
Super User
Super User

@AsanKani 

Very good!!

Yes, the trick with DefaultSelectedItems is that the schema/signature of the records for that property must match the Item property in order for selection to actually work.

A Lookup column in SharePoint has a record (or multiple if enabled) that has a Id and Value column.

Since you were setting the DefaultSelectedItems property to the actual lookup column from your list item, it would have that signature.  However your Items property was just your SharePoint list...which would have all the columns in it.  

So the trick was to just get the ID and the Title column and then to Rename them to Id and Value...this would then match properly.

 

Feel free to post more questions when you have them!

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

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 (5,752)