Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreThe FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now
I am trying to extract the display names of the fields being used in a visual from a Power BI embed. I am using the getDataFieldDisplayName function from the power bi authoring library. However this does not seem to work correctly on Field Parameters.
In the first instance (Image #1) I have dragged a field parameter into a table visual. When i get the datafields in the table visual I can see all the currently selected fields activated by the slicer. But when i try to fetch the displayNames for those fields it returns correctly for the first field but throws an undefined error for the rest.
In a second instance (Image #2)
I have added two fields "Currency" and "FileType" from the Field parameter and a third field "File Name" directly from the model (not from the field parameter). In this case File Name is being returned as the display name for the second "File Type" field.
Could someone please explain this behaviour or suggest any alternative methods to get the display names of the fields accurately. Image #1
Image #2
Hi @rohann,
Thank you for reaching out to the Microsoft fabric community forum.
Field Parameters are dynamic, so they don’t behave like normal columns. Because of that, getDataFieldDisplayName is not able to correctly return the display name for all the fields coming from the parameter.
That’s why you are seeing First field name coming correctly, but others showing undefined and When mixing parameter fields with a normal column, the display name getting mapped incorrectly
So the issue is not with your code. It happens because the API reads static metadata, while Field Parameters switch fields dynamically at runtime. For now, you may need to rely on the information from getDataFields() and handle the display name mapping manually on your side.
Hope the above provided information help you resolve the issue, if you have any further concerns or queries, please feel free to reach out to us.
Regards,
Community Support Team.
Thanks for the prompt reply.
Is this some kind of documented limitation? Since I did not find any. Or is this just found by exploration.
Hi @rohann,
Thank you for reaching out to the Microsoft Community Forum.
No, there isn't any official Microsoft documentation that explicitly states this as a limitation. I simply observed it from my understanding and working knowledge of how Field Parameters work they are resolved dynamically at runtime and how the authoring APIs operate (they rely on static metadata).
Regards,
Community Support Team.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |