cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Need help with linking two sharepoint lists in same gallery

Hi everyone,

I have 2 Sharepoint lists, let's say ListA and ListB and they are both connected to my PowerApps canvas app

 

ListA has fields

ID    Currency

1        EUR

2        USD

3         JPY

4        CNY

 

ListB has fields

ID     

1

1

1

3

4

 

I made a gallery consists of ListB items and now I would like ListB to show the Currency matching the IDs in ListA instead of showing the numbers so ideally the gallery will show

 

EUR

EUR
EUR
JPY
CNY

 

is this achievable? If not, what are the alternatives? Thank you all in advance 🙂

@v-micsh-msft @cherie 

3 ACCEPTED SOLUTIONS

Accepted Solutions
Highlighted
Super User II
Super User II

Re: Need help with linking two sharepoint lists in same gallery

This should be achieveable with the Lookup function, something like this:

 

LookUp( ListA, ID = ThisItem.ID, Currency), put this code in the Text property of the gallery label.

 

However, because both columns are called 'ID' PowerApps may throw a tantrum which means you'll have to use disambiguation or RenameColumns() to fix it. RenameColumns would look like:

 

LookUp ( RenameColumns(ListA, "ID", "ID1"), ID1= ThisItem.ID, Currency)

View solution in original post

Highlighted
Super User III
Super User III

Re: Need help with linking two sharepoint lists in same gallery

@Anonymous 

This is definitely achievable.  My assumption is ID is a number type column and currency is a text type column.  No lookup type columns are being used in either collection.

 

The simplest way is to put a label in your gallery with the following code in the Text property.

LookUp(ListA,ThisItem.ID,Currency)

 

Another way is to put this code in the Items property of your gallery...

DropColumns(
    AddColumns(ListB,"Currency",LookUp(ListA,ThisItem.ID,Currency)),
    "ID"
)

 

...and then put a label with the following Text property in the gallery

ThisItem.Currency

 

My preference would be the 1st option.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Need help with linking two sharepoint lists in same gallery

Thank you guys so much! @mdevaney @Eelman 

 

I made it work by combining both of your answers. 

 

I changed the text field of the label as LookUp(ListA, ID = ThisItem.ID, Currency) and it worked perfectly without name ambiguity problems 🙂

 

I appreciate your help and have a nice day where ever you are!

View solution in original post

4 REPLIES 4
Highlighted
Super User II
Super User II

Re: Need help with linking two sharepoint lists in same gallery

This should be achieveable with the Lookup function, something like this:

 

LookUp( ListA, ID = ThisItem.ID, Currency), put this code in the Text property of the gallery label.

 

However, because both columns are called 'ID' PowerApps may throw a tantrum which means you'll have to use disambiguation or RenameColumns() to fix it. RenameColumns would look like:

 

LookUp ( RenameColumns(ListA, "ID", "ID1"), ID1= ThisItem.ID, Currency)

View solution in original post

Highlighted
Super User III
Super User III

Re: Need help with linking two sharepoint lists in same gallery

@Anonymous 

This is definitely achievable.  My assumption is ID is a number type column and currency is a text type column.  No lookup type columns are being used in either collection.

 

The simplest way is to put a label in your gallery with the following code in the Text property.

LookUp(ListA,ThisItem.ID,Currency)

 

Another way is to put this code in the Items property of your gallery...

DropColumns(
    AddColumns(ListB,"Currency",LookUp(ListA,ThisItem.ID,Currency)),
    "ID"
)

 

...and then put a label with the following Text property in the gallery

ThisItem.Currency

 

My preference would be the 1st option.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

 

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Need help with linking two sharepoint lists in same gallery

Thank you guys so much! @mdevaney @Eelman 

 

I made it work by combining both of your answers. 

 

I changed the text field of the label as LookUp(ListA, ID = ThisItem.ID, Currency) and it worked perfectly without name ambiguity problems 🙂

 

I appreciate your help and have a nice day where ever you are!

View solution in original post

Highlighted
Super User III
Super User III

Re: Need help with linking two sharepoint lists in same gallery

@Anonymous 

No problem at all.

 

If we both helped you can Accept both of our answers as the solution.  ♥️ Share the love ❤️

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Watch Now

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,864)