cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Anonymous
Not applicable

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

mdevaney
Community Champion
Community Champion

@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

Anonymous
Not applicable

Thank you guys so much! @mdevaney @Anonymous 

 

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
Anonymous
Not applicable

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)

mdevaney
Community Champion
Community Champion

@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."

 

Anonymous
Not applicable

Thank you guys so much! @mdevaney @Anonymous 

 

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!

@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
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,629)