Class toggle based on null reply

Hello,

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.

Here is the query result:

Here is my logic:
image
Condition:
(encounter_get.data.get_patient_payer_status == null)

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.

Any help on this would be greatly appreciated.

try please
!encounter_get.data.get_patient_payer_status

Thanks for the suggestion.

I set the condition as recommended:
image

However, the class did not change.

I’ve also confirmed that the value returned from the server is null:

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.

Selected from action picker:
image

Then added “!” in Code view:
image

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.

1 Like

I was going to suggest this, but he says that there is another place where it is working. So this is unlikely.
Doesn’t hurt to check though. :sweat_smile:

1 Like

Thank you @sid, @JonL, @mebeingken and @s.alpaslan!

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.

Problem solved!

4 Likes