Status indicator not displaying correct information in table

Hello,

I am trying to add a status indicator to my table. I included it in a column that has a format of Boolean. I have tried a number of different ways of setting the "Show when" in the Edit State of the status indicator. For example:

Screenshot 2025-01-15 124924

I have also tried

{{ item = 'true' }}
{{ true }}

For some reason, it shows all of the fields in that column as being true.

Screenshot 2025-01-15 124944

RIght now, all of these should be false and showing a red indicator, not green. Can anyone tell me what I am doing wrong?

Hello @tomm ,

In Retool, when working with a Boolean column, you can use {{ item === true }} to conditionally show the status indicator.

image

1 Like

Thanks @WidleStudioLLP.

Do you happen to know, since I am using a Boolean field, how do I prevent the checkmark from showing in the column and instead just show the status indicator?

Use the same code for that and apply it to your Boolean column.

2 Likes

I did that, but it still shows the checkmark and then the status indicator.

You want it like this !

ScreenRecording2025-01-16182122-ezgif.com-video-to-gif-converter

2 Likes

That is the way I have it set up, but it still shows the checkbox, or I tried one in a text field as well and it still shows the text.

@tomm could you share a screen shot of what the column looks like and what the inspector panel looks like?

You said above it shows checkmark 'and then' status indicator, so curious to see if this is something we can change via styling in the inspector tool vs if this is all data for the cell.

1 Like

I have one column that is a text field. Here is a shot of the that column:

Screenshot 2025-01-15 124944

My fix to get rid of the text was to make the cell font transparent, but as you can see, it still takes up space and doesn't allow me to really center the indicator.

Here is the set up for the indicator:

Screenshot 2025-01-17 084154

Here is another column that uses boolean:

Screenshot 2025-01-17 083924

And here is the way I have that one set up:

Screenshot 2025-01-17 084058

Thanks in advance for your assistance.

Hey just did some testing, if you want to get rid of the text of 'good' or 'no' from the colored tag then you would just need to remove the text from the 'Label' input field, as I did here below in my screenshot.

This way it will only show the thumbs up or thumbs down icon with the color as you specify. I think that is what you are looking to do, correct?

Hi @Jack_T ,

Actually what I am trying to do is get rid of the text in the cell next to the status indicator.

For the time being I set the text color to transparent, but it still takes up the same space making it impossible to center the status indicator in the cell. So I don't want to stick with making the text transparent. I would rather get rid of it altogether.

I hope that makes sense.

@tomm Ahhhhhh ok that makes much more sense now :sweat_smile:

I did not see any text to the left of the Add On status tags in the previous screenshots.

If you want to remove the mapped value of the column and only have the icon+label from the Add On feature, I believe you can do this by switching the column Format to be Icon!

Let me know if that works for you :saluting_face:

@Jack_T, you'll have to forgive me here. I removed the mapped value of the column and only have the icon + label from the add-on feature and switched the column format to icon, but I don't see how to set the status indicator now. That column just shows blank cells now.

Can you share a screenshot of what it looks like now that you have made those changes?

You should be able to go into the the add-on feature and type out any text that you want to have inside of the icon using the label input.

Put into the Label input any text that you want to show.

@Jack_T, I left the field mapped to the database and changed the format to icon. I then removed

{{ item === "success" ? "/icon:bold/interface-validation-check-circle" : "/icon:bold/interface-alert-warning-circle" }}

from the icon field under Appearance, and that seemed to do the trick.

Thanks for your assistance.

Now if I can just figure out why I keep getting this error: "Insert into shipping failed: you must satisfy the constraint 'Shipping pkey1'" when I am trying to copy a record in the database, I would be pretty set. All I want to do is make an exact copy of a record and leave it in the same database. Any suggestions?

1 Like

So great to hear you got the icons working how you want!

Good question, I don't think I have gotten the same same error, but it sounds like the error is the primary key (pkey1) is missing :thinking:

Are you using Retool Database or your own separate database such as Postgres or MySQL?

I believe that Retool Database should automatically generate a primary key ID that is auto incremented when doing inserts.

May I ask why you are looking to have duplicate data in the same table? I am a little concerned this could lead to confusion when there are two rows with all the same data but different primary keys :sweat_smile:

Maybe inserting these into a different table would be better, but more context for the purpose is needed.