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
Eelman
Super User
Super User

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
Super User III
Super User III

@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 @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
Eelman
Super User
Super User

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
Super User III
Super User III

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

@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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (2,315)