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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
riyasdeen
Frequent Visitor

Custom Visual Object Property Integer Type Not Displaying

Hi,

 

I'm putting together a custom visual, I want to have an object property of type integer, but the no control shows up when I set type to integer, control is visible when type is numeric.

 

I don't want decimal values for this control, it should be integers. I can parse the float back to integer in  my code but it is not a neat solution. 

 

Below my capabilities.json

 

                "defaultZoomLevel": {
                    "displayName": "Zoom Level",
                    "description": "Default Zoom level for map, should be between 0 and 28",
                    "type": {
                        "integer": true
                    }
                },

 

 

Below my settings.ts

 

export class ProjectionSettings {
  public defaultZoomLevel: number = 7;
}

export class VisualSettings extends DataViewObjectsParser {
  public projection: ProjectionSettings = new ProjectionSettings();
}

 

 

Properties pane draws a blank when integer = true

riyasdeen_1-1626405008546.png

 

Shows a text control when numeric = true.

riyasdeen_0-1626404961349.png

 

Thanks for your time and support

 

Riyas

1 ACCEPTED SOLUTION
dm-p
Super User
Super User

Hi @riyasdeen,

For the properties pane to completely treat as an integer value, you need to add a validValues object matching the property name to the object instance when enumerating it. This should ensure that you get a control that will ensure whole values, or Power BI will coerce it for you so you don't have to manage it via code.

I honestly have no idea how I figured this out as it's not documented anywhere - the easiest way is to show you where I'd normally do this, so here you go.

Good luck!

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




View solution in original post

2 REPLIES 2
dm-p
Super User
Super User

Hi @riyasdeen,

For the properties pane to completely treat as an integer value, you need to add a validValues object matching the property name to the object instance when enumerating it. This should ensure that you get a control that will ensure whole values, or Power BI will coerce it for you so you don't have to manage it via code.

I honestly have no idea how I figured this out as it's not documented anywhere - the easiest way is to show you where I'd normally do this, so here you go.

Good luck!

Daniel





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


On how to ask a technical question, if you really want an answer (courtesy of SQLBI)




Hi @dm-p ,

 

That did the trick, thanks for your help. Appreciate it.

One of those undocumented goodies.

 

Thanks

Riyas

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.