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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

getting null value when console.log options

https://github.com/anjucvijayan/custom-visual/blob/main/visual.ts   --visual.ts file

https://github.com/anjucvijayan/custom-visual/blob/main/capabilities.json --- capabilities.json file

 

when i console.log options then it shows null values in data view . i have table view.
18.06.2024_20.16.32_REC.png

3 REPLIES 3
dm-p
Super User
Super User

Hi @Anonymous,

 

The linked repo doesn't look like a complete visual project to be able to tell, but from the looks of things, you're using a scriptResult mapping, which implies you're creating an R visual. In this case, the table data view mapping isn't populated, as expected. The dataset is dispatched to your R script by Power BI, and the results come back in dataViews[0].scriptResult (which is populated, as expected). In this case, you can only access the raw data before it is sent to the R runtime in your R script, not the visual's (minimal) TypeScript code (which only can evaluate the returned output).

 

The dedicated table data view mapping is only available for a TypeScript visual, and if this is what you intend to set up, you should set it up as per the documentation. This will then be available as you expect (but you won't be able to use R). I also wrote an article some years ago with a simple example of the table data view mapping for TypeScript, which may be helpful - this is a few years old, and the SDK has moved on a bit since then, but the principles should still be similar.

 

Regards,

 

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)




Anonymous
Not applicable

actually i need to create a histogram customvisual. so i need to add selection to the visual . so when i debug the code data view is not getting.  can't we add selection to r powered visual. if so on which file we need to edit. only on visual.ts file 
i have refered  
https://learn.microsoft.com/en-us/power-bi/developer/visuals/visuals-interactions

https://learn.microsoft.com/en-us/power-bi/developer/visuals/selection-api   these two documentations.


do we need to create histogram using visual.ts file
can you please share the steps to add visual interaction to my visual

If you're creating an R visual (which it looks like you're doing based on your capabilities), you do not have access to the table data view, and you cannot add selection. You can only get access to the script output, via the scriptResult object, meaning that you will not see the original dataset sent to the visual. This is only accessible to your R script.

 

For access to the table data view mapping and the interactivity APIs, you will need to develop the visual using TypeScript rather than R. You will also need to consider that selection IDs need to be reconciled back to the original data view row sent by Power BI (as Power BI generates the selectors and handles the interactivity on a visual's behalf).

 

You will also need to bear in mind that if you are transforming your source data into aggregated data, for display, your final result set might nto match this and you will very likely get unexpected results (unless you track and group your originally sent rows to the output and create selectors for all rows, so that when you cross filter these can all be sent back to Power BI to resolve).





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)




Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.

Top Kudoed Authors