Plain text not being displayed if empty

Hello! I am trying to display some fields from a table on a details page. However, when the value in the table is empty, the field is not being displayed.

For example, I would like to display the “IBAN” even if it is empty in this way "IBAN: "

That way, people know there is a field there and they have to fill it in via the “Edit” button. But if the value is empty, the whole text just disappears. Please see my example below in which I am using an IBAN text entry field to enter a value and then on the right side of the container, I would like to display it this way: IBAN: empty value

Would really appreciate any help here! And sorry if this question was asked before in some sort of way, I couldn’t seem to find a relevant thread about this and this seems like such a basic functionality that I’m wondering if I’m just blind for not being able to get it to work.

What you can do is create an if-then-else column:

  • If IBAN is empty, then “empty value”
  • Else IBAN

And then use that in your Fields component.

I am curious what the purpose of the Edit button is on your screen, given that you already have Input Components? ie. if users can edit the values directly, why the button?

That said, having input components sitting on a details screen like that is not really a good practice. It’s too easy for users to accidentally mess up your data. Editing data should be a deliberate action. So it would be better to use static (read only) components on your details screen, and then use an Edit button/action to open up an Edit screen.

1 Like

Hi @Darren_Murphy ! Thank you for your response!

So essentially what you’re saying is: I should have 2 columns for each field, one being the raw data input column where data comes in, and the other being a “display” column that I use on the UI?

Also, I did the text input on the same page as the display input so I can showcase the issue I’m facing, but thank you for the suggestion :slight_smile: !

If you want the columns to be displayed when the values are empty, then yes that’s what you need to do.

1 Like

Got it! The solution is not as elegant as I had hoped but I guess there is no other way :slight_smile:

I will mark this topic as solved!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.