Dynamic font icon

Hi,
I know this has been asked, and I have seen the post, but, i cannot seem to get it to work :frowning:

I have a boolean column in the DB table, so true or false.

In my code I have this:

<i class="fas fa-check fa-lg text-primary me-3" dmx-show="(SC_ViewClientDetails.status == 1)"></i>
<i class="fas fa-times fa-lg text-primary me-3" dmx-show="(SC_ViewClientDetails.status == 0)"></i>

but no icons show. The server connect is correct as I can get it to display true or false.

thanks

What does this expression show exactly when you check the server connect response?

SC_ViewClientDetails.status

You probably need something like:

SC_ViewClientDetails.data.queryname.status

(obviously alter ‘queryname’ to be the name you gave the DB query step that retrieves the column called status)

Your original expression is pointing to the status of the overall Server Connect call

When you check if you are using the correct expression, you can also do it with a single icon:

<i class="fas fa-lg text-primary me-3" dmx-class:fa-check="your.expression == 1" dmx-class:fa-times="your.expression == 0"></i>

thanks for that, it worked. It turned out the expression was wrong as well, not sure how as I used the data selector not hand typed, but it was wrong somewhere, when I copied it from the code that I had displaying true/false it worked, thanks everyone for the comments/help

1 Like