cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate III
Advocate III

Set Selected Value of Combo Box from Another Data Source

I am using PowerApps to customize a SharePoint list form. I have a combo box where Items = Sort(DataSource1.Title, Title)

 

and I am pulling from another data source using LookUp(DataSource2, selectedClientID = ID, value)

 

I want to use the lookup from the second data source as the default selected value of the combo box. Is this possible? I've tried adding the lookup to Default, DefaultSelectedItems, Adding Filter(ComboBox, Title = Lookup(..), Title)

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Hi @kayleegoose ,

Do you want to set a Default value within the ComboBox based on the result your LookUp formula returns?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following orkaround:

Set the DefaultSelectedItems property of the ComboBox to following:

{
  Title: LookUp(DataSource2, selectedClientID = ID, value)
}

If you enable Multiple selections within the ComboBox, please modify above formula as below:

Table(
         {
            Title: LookUp(DataSource2, selectedClientID = ID, value)
         }
)

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Responsive Resident
Responsive Resident

Hi,

 

One you get the lookup values, keep it in array format in a variable and use it as defaultselecteditems for combobox.

 

Mark it as verified if it answers your question.

Regards,

Pavan Kumar Garlapati

Thank you for your reply. The lookup function should only return one value. I changed it so that when the user selects something, a variable is set with the lookup function in it. When I add that variable to the DefaultSelectedItems, I get an error stating "Expected Table Value".

Also, when I switch it from Lookup to Filter, I don't get the same error until I try to use the form. Then I get an error saying "Conversion failed when converting the nvarchar value "Individual" to data type int". I'm pretty sure the choices in the combo box are text, not int. 

Community Support
Community Support

Hi @kayleegoose ,

Do you want to set a Default value within the ComboBox based on the result your LookUp formula returns?

 

Based on the needs that you mentioned, I have made a test on my side, please take a try with the following orkaround:

Set the DefaultSelectedItems property of the ComboBox to following:

{
  Title: LookUp(DataSource2, selectedClientID = ID, value)
}

If you enable Multiple selections within the ComboBox, please modify above formula as below:

Table(
         {
            Title: LookUp(DataSource2, selectedClientID = ID, value)
         }
)

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Perfect! Thank you so much!

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (74,783)