Empty text record shown

Hi!

I have an expression that splits text in two parts:

substitute(
index(
	split(
		concatenate(unique([Combined list])),
	concatenate([Current session number]," , "))
,2)
," , ",", ")

Sometimes the result is text that looks like this:

5,15, 34, 89

And sometimes the result is empty (nothing after the split).

My problem is that the record is shown even when nothing is in it. I’ve been able to hide such empty records with the following condition in the “Show” spot:

len([Name of column])<>0

Still, I wonder why AppSheet doesn’t hide it automatically. Empty records are usually not shown. :frowning:

Not sure what s happening, but did you try if this expression help ?

count(list([Name of column]))<>0

2 Likes

Thanks! I think that would work as a show condition too. I’m just not sure why I have to make a special show condition in this case.

I suspect the expression returns something blank space ish one which is treated as text value, but not count as list item when we turns to list from text with list() expression.
Out of my guess.

3 Likes

Try this:

substitute(
  index(
    (
      split(
        (" , " & unique([Combined list]) & " , "),
        (" , " & [Current session number] & " , ")
      )
      - list("")
    ),
    2
  ),
  " , ",
  ", "
)
2 Likes

Thanks for helping with this, @Steve!

Unfortunately, the problem of empty records being displayed occurs with your expression too:

Screen Shot 2020-07-24 at 12.31.22

An additional problem is that an unwanted comma is added to the end of the strings with text in them:

Screen Shot 2020-07-24 at 12.31.37

I’m happy with my current solution. The expression I wrote in my original post produces the text I wanted and the addition of the “len([This column])<>0” expression as a show condition does what I need it to do. I’m just not sure why the show condition is necessary with both my expression and yours. If the text length is 0, AppSheet shouldn’t show that column. Perhaps I should tell support@appsheet.com about this.

2 Likes

I just sent a brief e-mail about this issue to support@appsheet.com

2 Likes