Show region based on a value

I have a td region I want to show only if the logged in user unique id matches a certain value. Normally this seems like a very easy thing to do but I am getting an error.

Hi Brad,
What’s the exact expression you are using for this?

I have a recordset that has the logged in user details. Works perfectly. I have a small region I only want to show if staffId = 15.

My question is - what is the expression used for this? What is entered there?

Maybe I am just having a dumb moment but not sure what else I can tell you that is not in the screenshot?

I selected a link and ‘Dynamic Attributes’ —> ‘Show’ and then the settings in the screenshot.

Brad, can you open code view, copy what’s inside the dmx-show="" and paste it here?

That’s just it. Nothing is in the dmx-show="" … I get the error when trying to add the rules.

<a href="#" class="text-success" data-toggle="modal" data-target="#modalDeleteCheckin" dmx-on:click="modalDeleteCheckin.data_detailDeleteCheckin.select(track_id)" dmx-show="">
<i class="fa fa-times"></i></a>

Ok, what if you just manually enter there:

staffdetails.data.query1[0].staffId == 15

and also why not using a single query for that?

Is there a syntax to make it equal to the value 15?

staffdetails.data.query1[0].staffId == 15

I started this site before single queries were a thing in Wappler. And it is mush to big to change it now. :wink:

Ah, I see you just edited your reply. I will try that. Thanks.

Anyway it should not report this as an error, when adding it using the UI.
We will check this.

1 Like

Manually adding it worked. Thanks once again for the great support.

1 Like

Hey Brad,
Taking a second look at this issue, it seems to me that you just wrongly assigned the == in the UI.
It should be applied to the whole staffdetails.data.query1[0].staffId not just to the staffId, so in the UI just make sure to select the right element to add == to:

1 Like

Oh good lord. Of course. Sometimes I end up just looking at things too long and miss the obvious. Thanks again. That works perfectly.