Forum Discussion
Unable to add formatting options for custom visual
Hi Anonymous,
Capabilities are added to tell Power BI what objects and properties your visual will want to persist to the report for later retrieval. However, to display them for the user, you will need to write the necessary code to do so.
This code will typically include classes that match the structure of your capabilities (a class instance for each object and each class has to have properties with default values instantiated) and suitable logic to handle things that are not defined in the capabilities, such as enabling/disabling other properties based on what you choose in others or performing validation.
The Objects and Properties page in the developer documentation has a section that details how to get started with the code necessary for populating the formatting pane. Suppose you've created a brand new visual using powerbi-visuals-tools. In that case, there is usually a VisualSettings.ts (or similar file) that is generated, showing the necessary structure needed to match the capabilities that are generated from the template, and this may help you to get started.
Good luck!
Daniel