cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CollabTechie
Responsive Resident
Responsive Resident

Combobox DefaultSelectedItems based on SharePoint single text column string

Hi Folks,
I am using a combo box to patch to an SP single text column. However, when I open my app the combo box remains empty despite the 'Program Manager' defined within the list. When I set the DefaultSelectedItems property it returns an error as shown below

DefaultSelected.JPG

ProgramManager.JPG

 

How can I get around this?

Thanks
CT

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@CollabTechie 

If it is a simple table ["User1", "User2"], then this will result in a table with a single column called Value.

Therefore, your formula for the DefaultSelectedItems will be:

   {Value: Gal_NewRequests.Selected.'Program Manager'}

 

 

_____________________________________________________________________________________
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

4 REPLIES 4
RandyHayes
Super User
Super User

@CollabTechie 

DefaultSelectedItems is a record.  You are trying to assign a text value to it. 

You need to provide a record that matches the record schema of the Items property of your combobox.

What is the Items property?

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

I have manually entered an array ["User1", "User2"] etc. Would it be better if I made the SP column a choice column and used Choices(Datasource.ProgramManagers) and then set the DefaultSelectedItem based on this?

RandyHayes
Super User
Super User

@CollabTechie 

If it is a simple table ["User1", "User2"], then this will result in a table with a single column called Value.

Therefore, your formula for the DefaultSelectedItems will be:

   {Value: Gal_NewRequests.Selected.'Program Manager'}

 

 

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

That worked perfectly, thank you so much!

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (1,215)