cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

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.

Highlighted
Frequent Visitor

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.

 

 

 

Highlighted
Helper I
Helper I

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.

Highlighted
Helper I
Helper I

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
Advocate V
Advocate V

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (9,362)