How to hide data visualization in UI builder if there is no data
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-25-2024 10:31 PM - edited 03-25-2024 10:32 PM
I have a requirement in UI Builder - I need to hide the data visualization component if there is no data in the component, Kindly help me with the scripting.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-30-2024 04:07 AM - edited 03-30-2024 04:11 AM
I have done this multiple times for the Loader component. But you can do this for any other component.
- Create a client state to save the visibility (true/false)
- set this client state value by a special data broker or by a client script
It's done by a data broker result in this example
- Assign the visibibility of your component to the client state or use a little client script
It's done by a client script in this example
I hope this helps you! If "yes" give me a Helpful. 😉
I will always try to give a meaningful and valid answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2024 03:33 AM - edited 04-01-2024 05:59 AM
@Guido Bernuetz Thanks for the reply!!
I have tried your solution in my data visualization component, but it is not working.,
Actually i am trying to do the whenever the data or records is zero, i need to hide the component(Data Visualization) and if the record count is more than zero i want to show the component.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-01-2024 05:59 AM
@gowthamaa_mohan please find below 2 images, where I have added a OOB data resource "Look Up multiple records" and given the conditions as what you have mentioned in your Data script above.
This will give some output in an array. If that Array length is zero, then in that case, you will hide the Data viz. component.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2025 07:52 AM
This worked perfectly for my needs -- thank you!