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:
Solved! Go to Solution.
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
})
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:
Best regards,
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
})
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:
Best regards,
User | Count |
---|---|
247 | |
106 | |
82 | |
51 | |
43 |