cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

Gallery displaying data fields from multiple lists

I am new to PowerApps, being more familiar with designing Access Databases and SQL.  I am trying to build an app that will combine fields from 2 SharePoint Lists in a display gallery.

 

I assume that it can be done using a lookup function, but i am struggling to make it work.

The example lists are below

 

List 1 - Jobs 

JOB ID : Acccount Name: AccountID

JOB001: Bob & Sons: 1

JOB002: Smith & Western: 2

 

List 2 - Accounts

ID  : Title                    : Address

1   : Bob & Sons        : 1 High St, Old Town, OT1 5GH

2 :  Smith & Western : 2 Smith Road, Anytown, AY4 8LK

 

I would like a gallery to display the Job ID, Account Name and Account Address/Postcode.

 

The Account Name and AccountID are lookup columns from the Accounts list

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Gallery displaying data fields from multiple lists

Hi @Moores35,

Do you want to combine two SP lists (Jobs list and Accounts list), and display the combined result within a Gallery?

If you want to combine two SP lists (Jobs list and Accounts list), and display the combined result within a Gallery, I think the AddColumns function could achieve your needs.

I have made a test on my side, please take a try with the following workaround:3.JPG

 

4.JPG

Set the Items property of the Gallery control to following formula:

AddColumns(
    '20181026_case2_Jobs',
    "Account Address/Postcode",
     LookUp('20181026_case2_Accounts',Title=Account_x0020_Name.Value,Address)
)

On your side, you should type:

AddColumns(
     'JobsList',
    "Account Address/Postcode",
     LookUp('AccountsList',Title =Account_x0020_Name.Value, Address)  /* The Account_x0020_Name represents the Account Name column (LookUp column) in your Jobs List*/
)

In addition, above formula may cause a Delegation issue, in order to get rid of this issue, please take a try with the following workaround:

Set the OnVisible property of the first screen of your app to following:

ClearCollect(JobsCollection, 'YourJobsList');
ClearCollect(AccountsCollection, 'YourAccountsList')

Set the Items property of the Gallery control to following:

AddColumns(
     JobsCollection,
    "Account Address/Postcode",
     LookUp(AccountsCollection,Title =Account_x0020_Name.Value, Address)  /* The Account_x0020_Name represents the Account Name column (LookUp column) in your Jobs List*/
)

More details about the AddColumns function, please check the following article:

AddColumns function

 

Please also check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Can-I-add-fields-from-multiple-data-sources-i...

 

Best regards,

Kris

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

2 REPLIES 2
Highlighted
Community Support
Community Support

Re: Gallery displaying data fields from multiple lists

Hi @Moores35,

Do you want to combine two SP lists (Jobs list and Accounts list), and display the combined result within a Gallery?

If you want to combine two SP lists (Jobs list and Accounts list), and display the combined result within a Gallery, I think the AddColumns function could achieve your needs.

I have made a test on my side, please take a try with the following workaround:3.JPG

 

4.JPG

Set the Items property of the Gallery control to following formula:

AddColumns(
    '20181026_case2_Jobs',
    "Account Address/Postcode",
     LookUp('20181026_case2_Accounts',Title=Account_x0020_Name.Value,Address)
)

On your side, you should type:

AddColumns(
     'JobsList',
    "Account Address/Postcode",
     LookUp('AccountsList',Title =Account_x0020_Name.Value, Address)  /* The Account_x0020_Name represents the Account Name column (LookUp column) in your Jobs List*/
)

In addition, above formula may cause a Delegation issue, in order to get rid of this issue, please take a try with the following workaround:

Set the OnVisible property of the first screen of your app to following:

ClearCollect(JobsCollection, 'YourJobsList');
ClearCollect(AccountsCollection, 'YourAccountsList')

Set the Items property of the Gallery control to following:

AddColumns(
     JobsCollection,
    "Account Address/Postcode",
     LookUp(AccountsCollection,Title =Account_x0020_Name.Value, Address)  /* The Account_x0020_Name represents the Account Name column (LookUp column) in your Jobs List*/
)

More details about the AddColumns function, please check the following article:

AddColumns function

 

Please also check and see if the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/General-Discussion/Can-I-add-fields-from-multiple-data-sources-i...

 

Best regards,

Kris

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

Highlighted
Frequent Visitor

Re: Gallery displaying data fields from multiple lists

Kris,

 

A huge Thank You for this detailed explanation.

 

I was able to get this to work exactly as I wanted (after a few failed attempts because I kept overlooking the final close bracket)

 

Now I can start to add in filters etc.

 

Stuart

 

 

Helpful resources

Announcements
Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,354)