I need to get primaryImageAttribute from the Entity Metadata.
I'm wanting to render the primary image column in the grid cell in the CellRendererOverrides.tsx generateCellRendererOverrides function. My generateCellRendererOverrides function works fine ...
Now, context.utils.getEntityMetadata(entityName) returns a promise of the EntityMetadata. Here it is in my index.ts init method ...
When the EntityMetadata promise appears, the const variable primaryImageAttribute will be set to the primaryImageAttribue returned in the EntityMetadata promise.
So, to wait for the EntityMetadata promise and primaryImageAttribute to appear, I've wrapped async around an anonymous function and put await on the primaryImageAttribute variable.
There's no red squigglies in CellRendererOverrides.tsx or index.ts.
The Dev Tools debugger runs up to "return myValue" in the success function returned by "getMetadata(entityName).then( ..." that supplies the value for my primaryImageAttribute variable ...
And then no further breakpoints are hit. It just disappears.
Any ideas?
Or, my handling of the promise / async may be wrong or just simply not destined to work. If so, is there some non-promise, actual synchronous value, way of getting the primaryImageColumn value from the Entity Metadata?
Happy to hear that @LozzieD ! So glad I could help!
Have fun with your new project! 😉
By George and all the Saints, you nailed it Diana! Thank you!
Can't tell you how long I've laboured over that one as a newbie to the TypeScript, React, Fluent-UI, PCF "stack" above plain old JavaScript. Trying to over-complicate the async goings-on.
I've got my "PowerApps Editable Grid with image column rendered in a cell" project working now ...
Your blog always comes out on top for deep-dive insights when searching for PCF resources. I can see I need to methodically work through it rather than just pick up on the search hits! Xmas - New Year project ...
Thanks once again.
Hi @LozzieD ,
Instead of wrapping the async around the anonymous function, register the even right inside your metadata success function.
I've done the same inside this PAGrid PCF. Have a look: https://github.com/brasov2de/GridCustomizerControl/blob/main/CellRenderer/DianaGridCustomizerControl/index.ts
Maybe my blog might help too: https://dianabirkelbach.wordpress.com/2022/07/27/power-apps-grid-control-first-glimpse-to-the-cell-renderer-and-editors/
WarrenBelz
87
Most Valuable Professional
mmbr1606
71
Super User 2025 Season 1
Michael E. Gernaey
65
Super User 2025 Season 1