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 III
Super User III

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

View solution in original post

4 REPLIES 4
RandyHayes
Super User III
Super User III

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

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 III
Super User III

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

View solution in original post

That worked perfectly, thank you so much!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (27,184)