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

Re: Can I add fields from multiple data sources into a single gallery of items?

Hi

In my scenario,

I have 

Sharepoint list 1: Title,Product

sharepoint list 2: Title,MyProducts

  • Here Both Title columns are having different data.
  • And both Product and MyProducts Columns are lookups with different names and having same data.
  • In My Application, Dropdown1 has Title column form Sharepoint list 1
  • Dropdown 2 has Title column from Sharepoint List 2
  • Now I need to filter Dropdown2 Title values based on Dropdown1 Title values using similar data from Products and MyProducts lookup columns from two sharepoint list

Can anyone please help me with getting these values into PowerApp form.

Thanks in advance.

empecollins
Level: Powered On

Re: Can I add fields from multiple data sources into a single gallery of items?

If I am understanding your question correctly I am doing something similar with a Categories and Subcategories list in SharePoint.  

Categories  have Columns {ID, Title, Category}

SubCategories have Columns {ID, Title, CategoryLookup, Subcategory} where CategoryLookup is a Lookup field to the Categories list.

On my form I have a Category dropdown which looks up the categoryCapture.PNG

I also have a second field Subcategory which looks up the subcategory (needs to be related to the category, ignore the warning it has to do with delegation)

 

 

 

 

 

In the Items property for my Subcategory control I have the following expression:

SortByColumns(Filter(SubCategories,CategoryLookup.Value = CategoryLookupFilter_Dropdown.Selected.Value),"SubCategory")

The key is the Filter function.  

SubCategories - Data source pointing to my Subcategories list in SharePoint

CategoryLookup - Column in the Subcategories list 

CategoryLookup.Value - I get the Value property from the lookup, I could use the ID property as well would need to adjust the other side of the equation

CategoryLookupFilter_Dropdown - the control on my PowerApps form

CategoryLookupFilter_Dropdown.Selected.Value - gets the value that was selected in the dropdown

 

If I used the IDs the code would be

SortByColumns(Filter(SubCategories,CategoryLookup.Id = CategoryLookupFilter_Dropdown.Selected.Id),"SubCategory")

I wrap the result in a SortByColumns command to sort the data by the SubCategory column of my filtered datasource.  

 

Hope this helps.

 

 

 

akmiecik1
Level: Powered On

Re: Can I add fields from multiple data sources into a single gallery of items?

does not help at all, that link provides no content on having multple datasources.

Adi2ro
Level: Powered On

Re: Can I add fields from multiple data sources into a single gallery of items?

I don't understand how this works since you are doing a add column a gallery and it's a lookup. 

Highlighted
LinnZawWin
Level: Powered On

Re: Can I add fields from multiple data sources into a single gallery of items?

@rgruian is method 1 working with CDS data source?

 

gallery1.Items = AddColumns(Table1, "Region", LookUp(Table2, Name = Table1[@Name], Region))

 

 

I tried the formula below but it just returns an empty column for "Assessment Section"

AddColumns(
    'Assessment Details',
    "Assessment Section",     
    LookUp('Assessment Questions','Assessment Question' = 'Assessment Details'[@'Assessment Question'].'Assessment Question', 'Assessment Section')
)

 

This is the entity relationships for those 3 entities

Assessment ERD.png

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

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 (3,527)