cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to deal with null values in a Datatable component using React

dannya101
Newcomer

Hi currently I am pulling data from a DQL query I want to show the results to a Datatable though some of the values show in one of my columns and it leaves that row value blank because it is null. I was wondering if there was something in DQL or in react using the Datatable component that act like a conditional statement saying if this row value is null then print null as the row value. I saw there was a Datatable.Emptystate prop but I was not sure how to specify that a single value in a row was empty not the whole dataset. Any ideas how I can develop that. Photos are attached below of what I am working with.

1 REPLY 1

educampver
Dynatrace Advisor
Dynatrace Advisor

Hi @dannya101, the DataTable allows you to customize how specific cells are rendered. In your case it would suffice to check for null values and render whatever you deem best. Here's the documentation https://developer.dynatrace.com/design/components-preview/tables/DataTable/#customize-cell-rendering.

Best, Edu.

Featured Posts