Hi is there a way to display a column label via the Fields Content if the column does not contain a value?
You could create an if-then-else column, something like:
- If value is empty, then āNot setā
- Else value
And then use that column in place of the value in the fields component
@Darren_Murphy thanks but does that mean creating a duplicate if-then-else column for every column if any column may be empty?
Yes, it would.
So if you have lots of them then itās probably not a great solution.
Iāve not used the fields component much. Iāll have a look at it and see if there is a better option.
@Scotttiey - I just had a quick look, and now I can see why I donāt use it. Itās not very flexible, and you canāt assign actions. Fine for a handful of columns, but not the best choice for any more than that.
How many columns do you have?
Iād probably look to use something else, depending on what you need it to look like. Maybe a markdown table in a rich text component, or even coerce the columns into a list that could be used in a collection.
Usually what I do is a rich text component, powered by HTML that I generated from JavaScript. That gives me the ability to be flexible in cases like this.
However, you would need to combine all the info needed into a template column first.
Seems like overkill for a no-code platform
If only we have some sort of a basic table component for Pages, then my life would be much easier.
The final product from the process above looks somewhat like this.
Yeah, HTML is my choice for tables as well. Although I didnāt suggest it in this case as I could see the opening to a rather deep rabbit hole looming
Iām just curious - why would you use JavaScript to generate HTML? Is that to apply inline styling, orā¦?
I have a list of info with some fields that can be empty. In some cases, I donāt want to generate empty ārowsā for fields that have no value, or in some cases clients tell me to make them āTBDā for example.
With a template column and JS to handle an array I created from splitting the template column, I can be flexible on what to do with those empty values.
Also, wish the JS column allows more input variables
Pass it a JSON object, and then use JSON.parse()
to unpack it. Then you can have as many variables as you want
Thatās what I do with that Audit Log concept.
I agreeā¦the Fields component doesnāt cut it.
Yeah, but still have to pack it into a template column first haha.
Find it strange that this is missing. It creates a bad UX experience. A toggle option would be great on Fields, āShow label if column emptyā as at least that gives users the option