Dynamically Hide/Show Alert

I'd like to hide or show the Alert component based on the outcome of a Resource Query. Basically, show notification if there are results (else hide notification).

The component mentions that the setHidden function could be used to set the hidden field value, but when I use the setHidden function (in a JS Query) the query fails.

  • message:"controlName.setHidden is not a function"

I am aware that I could use the showNotification via Utils but that is not the desired UX.

In the Alert settings, within the "Layout" there is "Hidden" setting. If this value is set to true your element will not appear. Using if to check results of the query can get you the desired outcome so you can dynamically show or hide the alert.

An example demonstrating this feature.

1 Like