I am trying to apply a “Class Toggle” if my query returns a null value. The reason for this is to alert the user of a certain condition having been/not been met.
To be more specific, the query is the second step of an initial query as shown below.
I have a similar class toggle based on a values not null that’s working nicely, but can’t figure out how to make this specific instance work when the subquery returns null.
I’ve tried putting null in quotes and that didn’t work as well as doing things with length count and using values of the query fields >0 without luck.
The condition looks fine. With operator or equal to.
Can you check if the path of varuable you are trying to acces is correct?
Try selecting it from action picker. Or check in console using dmx.parse.
Also, if you can arrange to share your page, that would be even more helpful.
If either syntax should work, maybe Wappler has an issue evaluating null values?
I am sorry, but I don’t know how to use dmx.parse to check in the console. If you point me in the right direction (did not find anything obvious in forum search) I’ll do my best.
All my dev is local at the moment. Going to have to configure production prior to a push to give page access.
If you type dmx.app.data return in the dev console, you can see all the current values of all the components. dmx.parse(“your command”) allows you to execute any dmx command.
And if you do something like dmx.app.data.encounter_get… Or dmx.parse(“encounter_get…”), see what the output is.
Try with empty single quotes instead of null in your condition. Maybe the null is gettings aprsed as empty by Wappler.
Have you checked in the HTML if the class is actually being toggled or not and not just if you notice visually a change? Maybe the condition is being evaluated correctly.
Your troubleshooting tips were instrumental in diagnosing the issue. Looking at the CSS, the class was applied correctly but was being overridden by another class.