cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rthompsoneu
Level: Powered On

Combo Box - How to update the DefaultSelectedItems getting the existing data from a different data source

Hi

 

I am trying to update the DefaultSelectedItems loading the existing records from a different data source.

 

For example the existing data exist in a table called "Sample Group Detail", but the combo box has a different data source table called "Sample".

 

I need to get the existing records from "Sample Group Detail" and add the records to "Sample" combo box to show the existing records that have already been selected.

 

The "Sample Group Detail" table contains a Lookup field called "new_sampleid".    The "Sample" table primary key is "new_sampleid".

 

I am trying to use the below formula, but this does not work.

 

ShowColumns(Filter('Sample Group Details',GUID('Sample Group'.'Sample Group') = GUID(txt_SearchOption.Text)),"new_sampleid","new_name")

2 REPLIES 2
Community Support Team
Community Support Team

Re: Combo Box - How to update the DefaultSelectedItems getting the existing data from a different data source

Hi @rthompsoneu ,

Could you please share a bit more about the daya source used in your app? Are they both CDS Entities?

Do you want to display the "new_name" column value from your "Sample Group Detail" data source within the Sample ComboBox as default selected value?

Could you please share more details about the formula you typed within the Items property of the Sample ComboBox?

 

Based on the issue that you mentioned, I think there is something wrong with your formula. Please consider modify your formula within the DefaultSelectedItems property of the Sample ComboBox:

ForAll(
            ShowColumns(Filter('Sample Group Details', GUID('Sample Group'.'Sample Group') = GUID(txt_SearchOption.Text)),"new_sampleid","new_name"),
            {
                 Value: new_name
            }
)

If the SampleComboBox use ColumnA from your Sample data source as the display value, please modify above formula as below:

ForAll(
            ShowColumns(Filter('Sample Group Details', GUID('Sample Group'.'Sample Group') = GUID(txt_SearchOption.Text)),"new_sampleid","new_name"),
            {
                 ColumnA: new_name
            }
)

Please 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.
rthompsoneu
Level: Powered On

Re: Combo Box - How to update the DefaultSelectedItems getting the existing data from a different data source

Hi  

 

 

 

 

 

 

ForAll(
            ShowColumns(Filter('Sample Group Details', GUID('Sample Group'.'Sample Group') = GUID(txt_SearchOption.Text)),"new_sampleid","new_name"),
            {
                 Value: new_name
            }
)

I did try changing the code to do something like this:

I am not sure what format the data should be on the Dataselecteditems

 

ForAll(
            ShowColumns(Filter('Sample Group Details', GUID('Sample Group'.'Sample Group') = GUID(txt_SearchOption.Text)),"new_sampleid","new_name"),
            {
                 DisplayField: new_name,
                 ID: new_sampleid
            }
)

I also tried using the below formula without the Showcolumns

ForAll(
            Filter('Sample Group Details', GUID('Sample Group'.'Sample Group') = GUID(txt_SearchOption.Text)),
            {
                 ID: new_sampleid,
                 DisplayField: new_name
            }
)

Please see the attachment

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,212)