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

Combing Sharepoint Data Sources in Gallery

Hi Everyone,

 

I have two data sources. Data source 1 which has territories and lots of other information, and data source 2 which has names and identifiers.

Currently I have a gallery that is based on data source 1. Rather inefficiently, the name combobox is linked to a sharepoint choices column in data source 1 where I have copy and pasted a bunch of names (300+) from data source 2 in as choices.

This allows me to simply use:

 

 

Choices(Structures.'Name')

 

 

 

To get a list of names that users can select and don't have to type in (potentially incorrectly). This is then linked to data source 2 via a look up label to get the identifier code which is then patched into dataset 1.

 

This functions, but isn't great. If names change, I have to go in and edit the choices list, which is unncesscary as it's already captured in the other data set!

Therefore I want to change the column type to free text, and point the combobox to data source 2 directly to get the options. This is working with:

 

 

Distinct('Employee List',EMPLOYEE_NAME)

 

 

However, the default selected item is broken and the combobox search box doesn't seem to be functioning (which is crucial as there are so many names!). Also it's causing issues with my patch function.

 

Can anyone advise on how to achieve this? It would be an AMAZING help!!

 

Kind regards,

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Combing Sharepoint Data Sources in Gallery

Hi @Danb3434 ,

Do you change the 'Representative Name 1' column from Choice type into Text type?

Do you add the ComboBox control within your Gallery?

 

If you have changed  the 'Representative Name 1' column from Choice type into Text type, please consider set the DefaultSelectedItems property of the ComboBox to following:

{
  Result: ThisItem.'Representative Name 1'
}

 

Please consider take a try with above soluton, 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

7 REPLIES 7
Danb3434
Level: Powered On

Re: Combing Sharepoint Data Sources in Gallery

Hey, does anyone have any suggestions on this? Would be hugely appreciated!!

Community Support Team
Community Support Team

Re: Combing Sharepoint Data Sources in Gallery

Hi @Danb3434 ,

Could you please share a bit more about your scenario?

Is the 'EMPLOYEE_NAME' column a text type colum in your 'Employee' list?

 

If you connect the ComboBox to the data source 2 directly, please consider modify your ComboBox configuration as below:

Set the Items property of the ComboBox to following:

Distinct('Employee List',EMPLOYEE_NAME)

set the DefaultSelectedItems property of ComboBox to following:

{
  Result: ThisItem.Name.Value    // Name is a Choice type column in your Structures (data source 1)
}

set the IsSearchable proeprty of the ComboBox to following:

true

 

In addition, if you use Patch function to patch data to your data source 1, please consider modify your Patch formula as below:

Patch(
      'DataSource1',
       Defaults('DataSource1'),
       {
        ...
        'Name': {                                  // pass the selected ComboBox value into the Name Choice column in your data source 1
                 Value: ComboBox1.Selected.Result
              },
        ...
        ...
       }
)

 

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

Re: Combing Sharepoint Data Sources in Gallery

Hi v-xida-msft,

 

Thanks for getting back to me!

 

To be clear, I want to move away from having a choices column in the sharepoint data source, as this felt like a poor solution. If names changed I would have to go into the sharepoint column settings and manually add/remove choices. Therefore I have changed this column to be a text column, therefore setting DefaultSelectedItems property to:

{
  Result: ThisItem.'Representative Name 1'.Value    // Name is a Choice type column in your Structures (data source 1)
}

As you suggested, does not work and PowerApps complains about the .Value aspect of that formula.

 

So I have set the Items property to what you suggested, which works in terms of getting the items when the combobox is in the edit form.

I have also set the IsSearchable property to true (weird, can that turn itself off somehow, as it was working before) and that is now functioning.

 

Thank you so much for your continued support!

Danb3434
Level: Powered On

Re: Combing Sharepoint Data Sources in Gallery

Hi @v-xida-msft ,

 

Tried a couple of other solutions but nothing working! Very fustrating as seems relatively simple, any further suggestions sir?

 

Kind regards,

Community Support Team
Community Support Team

Re: Combing Sharepoint Data Sources in Gallery

Hi @Danb3434 ,

Do you change the 'Representative Name 1' column from Choice type into Text type?

Do you add the ComboBox control within your Gallery?

 

If you have changed  the 'Representative Name 1' column from Choice type into Text type, please consider set the DefaultSelectedItems property of the ComboBox to following:

{
  Result: ThisItem.'Representative Name 1'
}

 

Please consider take a try with above soluton, 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

Danb3434
Level: Powered On

Re: Combing Sharepoint Data Sources in Gallery

Hi @v-xida-msft ,

 

Yes, I have changed it from a choice column to a text column and I'm so happy that your solution WORKED!

 

The only final issue is the save button isn't working. Currently it is set up as:

Patch(Structures,ThisItem, {'Representative Name 1': Rep_select})

 PowerApps doesn't complain with the formula until I test it and then it gives an unknown error.

Any suggestion on this final issue?

 

Kind regards,

Danb3434
Level: Powered On

Re: Combing Sharepoint Data Sources in Gallery

Got it working with:

Patch(Structures,ThisItem,{'Representative Name 1': Rep_select.Selected.Result})

Thanks for all your help @v-xida-msft  

Helpful resources

Announcements
thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

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