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

Combo Box DefaultSelectedItems from Collection values from SharePoint List

Hello,

 

I am looking to have a Multiple Selection Combo Box be preselected with some of the values available. I have a SharePoint List with some entries that a user can choose from the PowerApp and it loads that entries values in to Labels. They can then choose to edit some of these fields. When the user chooses to edit the field, that Combo Box appears and I would like it to populate with the values that the entry has. When the user chooses to edit that field, I have a formula that looks at the value and parses it out since it is a string. Then it looks at each value and looks it up in another SharePoint list that the Combo Box also ties into for the options available. I add these values to a Collection and have been trying to get the formula correct in the DefaultSelectedItems property as well have been messing around with the Default property.

 

Some of the formula I have been trying in the DefaultSelectedItems propert without any luck. LocUsed is the name of the Collection. Loc is the name of the column in the LocUsed Collection.

ForAll(LocUsed, {Loc: 'Location Table'.'Location ID'})


LookUp('Location Table', 'Location Table'.'Location ID' = LocUsed.Loc)

 

I have tried some variations of the above. I get it to say it has no errors but it never populates the value. I think I am missing how the Combo Box wants to read in from the table of what items to be preselected.

 

Feel free to ask me for additional details if needed.

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

@NHammond37 

So then, your ComboBox items has only ONE column - 'Concatenated Name'.

Your DefaultSelectedItems needs to match that:

ForAll(LocUsed, {'Concatenated Name': Loc})

This assumes that Loc is the matching column in your LocUsed (collection, variable, etc)

If it is not, then replace with the appropriate one.

_____________________________________________________________________________________
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.
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

5 REPLIES 5
RandyHayes
Super User
Super User

@NHammond37 

What is the Items property of your ComboBox?  

To have items selected, the DefaultItemsSelected records MUST match the signature (columns) of the Items property exactly.

 

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Filter('Location Table'.'Concatenated Name', Not("DO NOT USE" in 'Concatenated Name'))

 

This is the Items property on the Combo Box. I had to filter it a little bit to get rid of locations that shouldn't be used. Are signature columns like the ID column on a SharePoint List or can you set columns you create as signature columns as well?

@NHammond37 

So then, your ComboBox items has only ONE column - 'Concatenated Name'.

Your DefaultSelectedItems needs to match that:

ForAll(LocUsed, {'Concatenated Name': Loc})

This assumes that Loc is the matching column in your LocUsed (collection, variable, etc)

If it is not, then replace with the appropriate one.

_____________________________________________________________________________________
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.
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

Thank you so much!!! It's working!! I've been trying to figure out what was wrong for awhile now.

@NHammond37 

Always a good learning process to hash it out on your own, but if it starts to frustrate, come on over to the forum and post 🙂

_____________________________________________________________________________________
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.
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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,640)