cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Connor55
Resolver I
Resolver I

Using Lookup Fields in a Gallery - Within a Component

This is a bit different than my original thread, so I've created a new topic.

Old Thread:
https://powerusers.microsoft.com/t5/Building-Power-Apps/How-to-use-a-gallery-in-a-component/m-p/4719...

 

I'm able to reference all the fields of the entity I have set as the "Items" property of my gallery component - except the lookup fields.

None of them are showing up in these drop downs you get:

Screen Shot 2020-02-17 at 8.14.10 PM.png

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Connor55 ,

Do you want to display LookUp field value from your CDS Entity within this Gallery Component directly?

 

If you want to display the LookUp field value from your CDS Entity within this Gallery Component directly, I afraid that there is no way to achieve your needs in PowerApps.

 

Actually, the data field you could display within the Gallery Component is based on the table structure you defined within the Items property of the embedded Gallery within this Component. But only simple data type fields are supported in the Items property of the  embedded Gallery, the complex data type fields (e.g. LookUp type, Option Set type, Two Options type, ... etc) are not supported.

 

As an alternative solution, you could consider define a simple data type field within the Items property of the embedded Gallery within this Component:

Table({
       ProductName: "SampleText", 
       ProductionArea: "SampleArea", 
       Price: 100, 
       LookUpFieldValue: "SampleLookUpValue"     // Add this new data field to display LookUp column value
    })

4.JPG

 

Then within your app screen, insert above Gallery component. Then set the Items property to following:

AddColumns(TaskLists, "NormalContactFullName", 'Normal Contact'.'Full Name')

Note: The 'Normal Contact' is a LookUp type field in my TaskLists Entity.  Pull the 'Full Name' property under the 'Normal Contact' field into a new column name "NormalContactFullName", then you could bind the LookUpFieldValue property specified in above Gallery component to the "NormalContactFullName" column.

On your side, you may need to type following formula:

AddColumns('CDS Entity', "LookUpColumnValue", 'LookUp Field'.DisplayColumn)

Replace the DisplayColumn with actual column name under the "LookUp Field", DisplayColummn represents the column value you want to display within the Gallery component

 

After that, the LookUpFiledValue could display within the Gallery component as below:

5.JPG

 

Best regards,

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

1 REPLY 1
v-xida-msft
Community Support
Community Support

Hi @Connor55 ,

Do you want to display LookUp field value from your CDS Entity within this Gallery Component directly?

 

If you want to display the LookUp field value from your CDS Entity within this Gallery Component directly, I afraid that there is no way to achieve your needs in PowerApps.

 

Actually, the data field you could display within the Gallery Component is based on the table structure you defined within the Items property of the embedded Gallery within this Component. But only simple data type fields are supported in the Items property of the  embedded Gallery, the complex data type fields (e.g. LookUp type, Option Set type, Two Options type, ... etc) are not supported.

 

As an alternative solution, you could consider define a simple data type field within the Items property of the embedded Gallery within this Component:

Table({
       ProductName: "SampleText", 
       ProductionArea: "SampleArea", 
       Price: 100, 
       LookUpFieldValue: "SampleLookUpValue"     // Add this new data field to display LookUp column value
    })

4.JPG

 

Then within your app screen, insert above Gallery component. Then set the Items property to following:

AddColumns(TaskLists, "NormalContactFullName", 'Normal Contact'.'Full Name')

Note: The 'Normal Contact' is a LookUp type field in my TaskLists Entity.  Pull the 'Full Name' property under the 'Normal Contact' field into a new column name "NormalContactFullName", then you could bind the LookUpFieldValue property specified in above Gallery component to the "NormalContactFullName" column.

On your side, you may need to type following formula:

AddColumns('CDS Entity', "LookUpColumnValue", 'LookUp Field'.DisplayColumn)

Replace the DisplayColumn with actual column name under the "LookUp Field", DisplayColummn represents the column value you want to display within the Gallery component

 

After that, the LookUpFiledValue could display within the Gallery component as below:

5.JPG

 

Best regards,

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.

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 (5,043)