Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The 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

Reply
rohann
New Member

Using getDataFieldDisplayName for Field Paramter does not return correct values

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 #1Image #1Image #2Image #2 

 

3 REPLIES 3
v-hjannapu
Community Support
Community Support

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.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.