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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.